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  ##本地文件夹推到远程服务器
相关推荐
GoGeekBaird5 小时前
别再给每个 AI 做自我介绍了:我做了一个「个人上下文」管理系统
后端·github·agent
莫晓燚6 小时前
Ansible 13 个常用模块---企业实战
git·github
程序员柒叔8 小时前
Diagram Design 解构:45 种图型如何用语义路由与 SVG 质量门交付
人工智能·github·agent·skills
逛逛GitHub8 小时前
9 个神级 GitHub 项目助你蹭上抖音、小红书 Vibe 知识大赏热点。
github
m4Rk_8 小时前
【论文阅读】Agent 记忆机制(119):EvoLife——让具身 Agent 把主动问到的答案沉淀为可复用的空间经验
论文阅读·人工智能·学习·开源·github
后台模板学习11 小时前
GitHub Actions 与 Jenkins 在日志监
运维·github·jenkins
miofly11 小时前
GitHub 今日推荐|auto-ontology:给 Agent 装上企业数据的语义索引
python·开源·github
miofly14 小时前
GitHub 日榜趋势速报 | 2026-11-04
开源·github
钱栈up1 天前
GitHub 热榜上手|Orca:让多个编码 Agent 并排跑
github
wflynn1 天前
GitHub 日榜趋势速报 | 2026-11-02
开源·github