【发布时间】:2015-02-28 12:25:06
【问题描述】:
我在本地和 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
现在我的同事在他的机器上克隆了 master 分支并更新了一个文件,推送到 remote master 分支。
然后我想,哦,好吧,没关系,我可以这样做:
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.
可能是什么问题?有没有正确的方法可以做到这一点。
【问题讨论】:
-
您能否通过公开的存储库重现该问题?
标签: git github git-merge git-subtree