美文网首页
工具 - 如何处理 Git Pulling without sp

工具 - 如何处理 Git Pulling without sp

作者: CatchZeng | 来源:发表于2021-12-10 11:49 被阅读0次

原文:https://makeoptim.com/tool/git-pulling-without-specifying

问题现象

当执行 git pull 时,将会出现 Pulling without specifying 警告,如下所示:

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.

解决方法

你可以为每个 git 仓库设置策略,如下所示:

git config pull.rebase false

或者全局设置默认的策略,如下所示:

git config --global pull.rebase false

参考链接

相关文章

网友评论

      本文标题:工具 - 如何处理 Git Pulling without sp

      本文链接:https://www.haomeiwen.com/subject/cnjcfrtx.html