Github 最新的上传代码操作步骤

github取消了密码账号授权登录方式

原有的link到github账户后,还需要进行令牌的授权

首先需要创建一个令牌。可以参照以下链接
创建好令牌之后,以后需要执行
python 复制代码
git remote set-url origin https://[令牌代码]@github.com/xxx/xxx/

完整的操作流程如下:

python 复制代码
##先在github的网页端创建一个仓库

git init ##初始化本地仓库

git branch -m master main   ### 将本地的master 改为 main,与网页端的分支保持统一

git remote add origin  https://github.com/xxx/xxx  ##将本地仓库与远程仓库链接

git remote set-url origin https://[令牌代码]@github.com/xxx/xxx/    ## 授权验证

git pull origin main  ##从远程服务器拉到本地,保持对齐

git add .  # 添加本地文件

git commit -m "first commit"   ##提交

git pull --rebase origin main  ##解决! [rejected]        main -> main (non-fast-forward),避免直接push产生的bug

git push --set-upstream origin main  ##本地文件夹推到远程服务器
相关推荐
wangruofeng2 小时前
opencodex 解锁 Codex 任意模型,一个本地代理打通 Claude/Kimi/GLM/DeepSeek
llm·github·openai
一点一木4 小时前
从60首歌到1个网站:输入你的故事,还你一首歌
前端·github
刘较瘦_8 小时前
AI 开发中的 Git Submodule 父子仓库模式:前后端分仓管理与协作实践
前端·github
DeMinds11 小时前
内容没有丢,我为什么总在重新整理?|DeMinds 如何让工作接着继续
ios·github·markdown
寒水馨11 小时前
macOS下载、安装openclaw-v2026.7.1(附安装包OpenClaw-2026.7.1.dmg)
macos·大模型·github·开源软件·ai助手·openclaw·gpt-5.6
徐小夕12 小时前
花了3天,我写了一款开源AI公众号编辑器
前端·vue.js·github
CCPC不拿奖不改名1 天前
大模型推理架构与开源生态知识整理
数据库·windows·python·架构·langchain·开源·github
redreamSo1 天前
一天涨 1800 星的 GitHub 榜首:AI 编程瓶颈变成了 token
人工智能·开源·github
小弥儿1 天前
GitHub今日热榜 | 2026-07-20:AI Agent 知识体系迎来系统化梳理
学习·开源·github