在执行' git push origin分支时收到错误'

时间:2018-01-14 23:08:05

标签: git

当我做git push origin branch它告诉我

error: failed to push some refs to 'https://github.com/some-project...'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

但当我执行git pull时,它会将HEAD移回原点分支(即它会删除我本地新创建的文件),因此我必须进行硬重置。

我读了一些其他论坛,说要做一个git pull rebase(我不确定它是如何工作的)甚至是一个git push -force(这看起来不像我应该使用的东西至)。是否有其他替代方案,您可以详细说明或添加链接吗?

0 个答案:

没有答案