在git拉origin master之后,我得到了以下消息:

warning: Pulling without specifying how to reconcile divergent branches is
discouraged. You can squelch this message by running one of the following
commands sometime before your next pull:

  git config pull.rebase false  # merge (the default strategy)
  git config pull.rebase true   # rebase
  git config pull.ff only       # fast-forward only

You can replace "git config" with "git config --global" to set a default
preference for all repositories. You can also pass --rebase, --no-rebase,
or --ff-only on the command line to override the configured default per
invocation.

remote: Enumerating objects: 4, done.
remote: Counting objects: 100% (4/4), done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 4 (delta 0), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (4/4), 51.49 KiB | 850.00 KiB/s, done.

拉动似乎成功了,但我不确定。

我该怎么补救呢?


当前回答

已经有很多答案了,但是,我的处理方式是 如果你想从分支A拉到分支B

我首先从a中创建一个pull request到let,比如master。 确保所有冲突都得到解决,并将A合并为master。 然后简单地从主分支拉入分支B。

其他回答

Git拉源主-rebase

为我工作!

最安全的选择是只在全球范围内设置。运行:

git config --global pull.ff only

该选项将被添加到全局的.gitconfig中。

[pull]
    ff = only

如果快进后期失败,尝试git pull -no-ff。

在我的情况下,我只是简单地这样做:

git pull --rebase

我能够在本地分支上获得所有远程更改。

谢谢。

这对我很有用。

git reset --hard origin/<remote_branch_name>

对我来说,一旦我设置了配置,我仍然无法合并。 这是致命的:不可能快进,中止

上述解决方案都不起作用,所以我使用了合并和develop。合并起源/开发