工具 - 如何處理 Git Pulling without specifying 警告

原文: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

參考鏈接

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章