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  ##本地文件夹推到远程服务器
相关推荐
极光技术熊4 小时前
Spring AI 从入门到精通:构建你的 AI 开发知识体系
后端·github
用户39483951075535 小时前
怎么让我的 Agent 真正"懂"我?——关于记忆、经验学习与预测的一些真实体验
github
远航_11 小时前
git submodule
前端·后端·github
fthux12 小时前
如果你用 Mac,那你可能需要 Noti Shift
macos·开源·github
程序员天天困1 天前
Loop Engineering 实战:/goal 命令让 AI 自己写完整项目
github
徐小夕1 天前
我们开源了一款“框架无关”的思维导图编辑器,3分钟集成到任意系统
前端·javascript·github
小爷毛毛_卓寿杰1 天前
我把 397B 的「Agentic 大脑」塞进了 Xinference,一键部署 Nex-N2
人工智能·架构·github
小爷毛毛_卓寿杰1 天前
我把一个 3B 模型塞进了 Xinference,然后它干掉了 DeepSeek V3.2
人工智能·开源·github
凌奕1 天前
别用文档约束你的 Agent:聊聊 Agent 开发流程的思想
llm·github·agent
HelloGitHub2 天前
《HelloGitHub》第 123 期
开源·github