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  ##本地文件夹推到远程服务器
相关推荐
面包狗AI4S5 小时前
GitHub AI4S 项目观察(2026-08-07—2026-08-13)
人工智能·github
华科大胡子5 小时前
GitHub Actions自动化运维实战技术文章大纲
github
fthux6 小时前
装闭 RenoPit 源码解析(14):Demo模式、健康检查与Docker部署
人工智能·ai·开源·github·open source·renopit
TunerT_TQ6 小时前
Meta React 源码静态评测:从 4540 个源文件看 React Compiler 的工程化演进
meta·开源·github
峰向AI7 小时前
再也不怕换工具失忆了:它给 AI 编程助手装上"长期记忆"
github
tokenKe8 小时前
AirLLM:一张 4GB 显卡,把 70B 模型“流“起来 |SSP Github Daily
github
喜乐MI13 小时前
Git 分支操作避坑指南:merge、cherry-pick、revert 与 reset 怎么选?
git·github
程序员老赵13 小时前
Docker 部署禅道 ZenTao:轻松搭建研发项目管理平台
前端·后端·github
敢敢是只喵i15 小时前
已经登录 BailingHub,为什么 AI 还是不能查询订单?匿名预览与业务身份不是一回事
github
dong_junshuai15 小时前
每天一个开源项目#73 Munder Difflin:2.3K Star 的本地多Agent办公室
开源·github·agent