2
我們最近採用了我們自己的Git分支系統,但最近我們一直感到沮喪的一件事是,當試圖在一個分支上提交遠程更改時,Git停止提交,因爲一個不同的分支在它的遠程副本之後。因此,我們必須檢查每個已更改的分支,並在返回到我們的原始分支之前進行提交。Git:被其他分支拒絕的提交
是否有一個設置可以防止Git因爲其他分支而停止提交。我們可以採取哪些方法來防止需要切換分支?
我們最近採用了我們自己的Git分支系統,但最近我們一直感到沮喪的一件事是,當試圖在一個分支上提交遠程更改時,Git停止提交,因爲一個不同的分支在它的遠程副本之後。因此,我們必須檢查每個已更改的分支,並在返回到我們的原始分支之前進行提交。Git:被其他分支拒絕的提交
是否有一個設置可以防止Git因爲其他分支而停止提交。我們可以採取哪些方法來防止需要切換分支?
嘗試:
git config --global push.default current
應該避免的錯誤的信息mentioned here
error: failed to push some refs to '[email protected]: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
參見http://stackoverflow.com/a/12342080/6309 – VonC
就是那種設定的,在http://lists-archives.com/git/767304-push-default-current-vs-upstream.html中討論,這導致了Git1.7.11 +的新推送策略:http://stackoverflow.com/questions/4586687 /什麼,是在對結果的-混帳推產地/ 9749477#9749477 – VonC