Git:其他分支落后的提交已停止

时间:2012-11-28 09:41:33

标签: git branch commit pull behind

我们最近采用了我们自己的Git分支系统,但是我们最近一直感到沮丧的一件事是在一个分支上尝试将更改提交到远程时,Git停止提交,因为后面有一个不同的分支它的远程对手。因此,我们必须先检查已更改的每个分支,然后再返回原始分支进行提交。

是否存在可以阻止Git因其他分支而停止提交的设置。我们可以采取某种方法来防止需要切换分支吗?

1 个答案:

答案 0 :(得分:0)

尝试:

git config --global push.default current

应避免出现错误消息mentioned here

error: failed to push some refs to 'git@github.com:jkubicek/my_proj.git'
hint: Updates were rejected because a pushed branch tip is behind its remote
hint: counterpart. If you did not intend to push that branch, you may want to
hint: specify branches to push or set the 'push.default' configuration
hint: variable to 'current' or 'upstream' to push only the current branch