如何摆脱git分支中的非快进错误消息?

时间:2013-04-24 20:27:13

标签: git branch

我从主人那里分叉了一个分支A.然后过了一段时间我从分支A分叉了另一个分支B. 现在,每当我将代码推送到分支A上时,我都会看到下面的消息。我怎么能摆脱它?

   ff65b4e..304e3f6  A -> A
 ! [rejected]        B -> B (non-fast-forward)
error: failed to push some refs to 'git@xxx'
hint: Updates were rejected because a pushed branch tip is behind its remote
hint: counterpart. Check out this branch and merge 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 log --all --graph
* commit 304e3f60363fe734fc4eebab79b23a1dc6528ea3
| Author: xxxx
| Date:   xxxxxxxx
|
|    xxxxxxxxxx
|
* commit ff65b4e3ae91117f8ffb12a60ada81f888a94275
| Author: xxxx
| Date:   xxxx
|
|     xxxx

1 个答案:

答案 0 :(得分:0)

git checkout B
git pull

修正任何冲突

git push