今天提交git仓库的时候,遇到了如截图所示的问题,提示Your branch is up-to-date with ‘origin/master’.
这个问题一般是分支问题
这时候我们就需要新建一个分支
$ git branch newbranch
然后检查分支是否创建成功
$ git branch
然后切换到你的新分支
$ git checkout newbranch
然后将你的改动提交到新分支上
$ git add . $ git commit -m "备注"
然后切换到主分支
$ git checkout master
然后将新分支提交的改动合并到主分支上
$ git merge newbranch
然后就可以push代码了
$ git push -u origin master
最后还可以删除这个分支
$ git branch -D newbranch