記錄一下遇到 git pull之后出現(xiàn)異常 控制臺日志
Hint: You have divergent branches and need to specify how to reconcile them.
Hint: You can do so by running one of the following commands sometime before
Hint: your next pull:
Hint:
Hint: git config pull.rebase false # merge
Hint: git config pull.rebase true # rebase
Hint: git config pull.ff only # fast-forward only
Hint:
Hint: You can replace "git config" with "git config --global" to set a default
Hint: preference for all repositories. You can also pass --rebase, --no-rebase,
Hint: or --ff-only on the command line to override the configured default per
Hint: invocation.
Git failed with a fatal error.
Git failed with a fatal error.
Need to specify how to reconcile divergent branches.
修改 pull 的默認配置為 rebase
git pull = git fetch + git merge
執(zhí)行 git pull 命令時,默認是用 git merge 來合并代碼的。大家都知道,用 merge 合并代碼的節(jié)點不在一個分支上,不方便查看節(jié)點信息,所以很多公司是采用 git rebase 來合并代碼的。針對這種情況,可以在自己的電腦終端,修改 git 的全局配置,將 pull 的默認配置改為 rebase。
全局修改 pull 的命令:
git config --global --add pull.rebase true 劃重點?。?!
查看是否修改成功命令:
git config --global -l