Pulling without specifying how to reconcile divergent branches is discouraged - fancyfsz/FancyWiki GitHub Wiki

  1. This is the default behaviour. Pull is fast-forwarded if possible, otherwise it's merged.

    (默认行为,尽量以快进式拉取,否则被合并)

git config --global pull.ff true
  1. Pull is never fast-forwarded, and a merge is always created.

    (从不会进行快进式拉取,总是产生一条merge)

git config --global pull.ff false
  1. Pull is fast-forwarded if possible, otherwise operation is aborted with an error message.

    (尽量进行快进式拉取,否则行为将被废弃并产生一条报错信息)

git config --global pull.ff only

Tips:在 Git 中,"快进式拉取"(Fast-Forward Pull)是指在合并分支时,如果目标分支的变化可以简单地通过移动当前分支的引用来实现,那么就会使用快进合并。这意味着不需要创建新的合并提交,当前分支的 HEAD 指针直接移动到目标分支的最新提交。