https://www.cnblogs.com/iAmSoScArEd/p/16404267.html 我超怕的
对于已有的仓库,中途开发,git clone 下来修改后,git branch创建新的分支、提交代码并发起git merge合并请求。
# 1.如果还没创建自己的分支,先创建自己的分支 git branch 自己的分支名字 git checkout 自己的分支名字 # 2.提交自己最新的代码到自己的分支 git add . git push -u origin 自己的分支名字 # 3.切换本地主分支,更新本地的代码为远程仓库最新代码,并且发起将你的分支合并到master的请求 git checkout master git pull origin master git merge 你的分支名字 # 4.查看提交状态 git status # 出现下面的 几个commits 使用git push推送的消息说明成功 #On branch master #Your branch is ahead of 'origin/master' by 2 commits. #(use "git push" to publish your local commits) #nothing to commit, working tree clean # 5.提交代码 git push origin master