为什么Git不允许我快进合并了?如果我试图使用——ff-only强制它,我会得到消息“致命:不可能快进,终止。”我意识到合并-no-ff有巨大的优势,但我只是不明白为什么我现在不能-ff-only ?


当前回答

如果你有一个提交,尝试撤销它,再拉一次!

其他回答

我也面临着相同类型的问题,我猜我们中的许多人会面临这个问题,当我们进行结对编程时,我们也有来自其他用户的传入提交。这是我所面临的步骤,并通过git拉来解决它们——没有rebase

➜  graphql-tutorial git:(filtering)  git config pull.ff only 
➜  graphql-tutorial git:(filtering) git pull
fatal: Not possible to fast-forward, aborting.
➜  graphql-tutorial git:(filtering) git merge 
➜  graphql-tutorial git:(filtering)  git config pull.rebase false 
➜  graphql-tutorial git:(filtering) git pull                      
fatal: Not possible to fast-forward, aborting.
➜  graphql-tutorial git:(filtering) git pull --no-rebase
Merge made by the 'ort' strategy.
. <file name>
. <file name>
. <file name>
. <file name>
 5 files changed, 47 insertions(+), 9 deletions(-)
 create mode 100644 app/models/auth_token.rb

如果您在本地分支上执行git pull origin master时遇到此情况,请在记事本中打开.gitconfig(通常隐藏在C:\Users\Myname中)并添加这两行

[pull]
    ff = no

保存配置并再次尝试git pull origin master

这是我的工作,你可以用它git pull -no- off

If

git pull

不做的把戏,如果你想合并当前的变化和变化将来自分支从原点拉,然后这样做:-

git merge origin/BRANCH_NAME

之后,解决合并冲突,如果有的话,这一天就结束了。

尝试一下,会工作得很好----

Git拉原点-rebase