【问题标题】:Git: Commit stopped by other branch being behindGit:提交因其他分支落后而停止
【发布时间】:2012-11-28 09:41:33
【问题描述】:

我们最近在 Git 中采用了自己的分支系统,但最近让我们感到沮丧的一件事是,当尝试在一个分支上向远程提交更改时,Git 会停止提交,因为后面有另一个分支它的远程对应物。因此,我们必须检查每个已更改的分支,并在返回原始分支进行提交之前先进行拉取。

是否有一个设置可以阻止 Git 因为其他分支而停止提交。我们可以采取某种方法来避免必须切换分支的需要吗?

【问题讨论】:

    标签: git branch commit pull behind


    【解决方案1】:

    试试:

    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
    

    【讨论】:

    猜你喜欢
    • 2015-02-13
    • 2021-10-08
    • 2015-04-10
    • 2013-01-16
    • 1970-01-01
    • 1970-01-01
    • 2022-10-20
    • 2013-04-18
    • 1970-01-01
    相关资源
    最近更新 更多