我在本地和github(远程)有两个repo分支,即develop
和master
。但有一个重大区别。
master : identical to last working and stable develop branch
develop : development branch
master : used the following command for this `git subtree push --prefix dist origin master`
develop : development branch
现在,我的同事在他的机器中克隆了主分支,并更新了一个文件,推送到远程主分支。
然后我想,哦,好的,我可以这样做:
git subtree pull --prefix dist origin master
由于它与之前的push
命令正好相反,但它在更新的文件上给了我冲突,然后我想,好吧我只是修复并合并然后再次发生冲突subtree push
,但它给了我:
error: failed to push some refs to 'git@github.com:user/xxx.git'
hint: Updates were rejected because a pushed branch tip is behind its remote
hint: counterpart. Check out this branch and integrate the remote changes
hint: (e.g. 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
可能是什么问题?是否有正确的方式来执行此操作。
答案 0 :(得分:0)
如果您已经提交了一些提交,则可以执行以下操作
git pull --rebase
这会将所有本地提交置于新拉动的更改之上。