修改 pull 的默認(rèn)配置為 rebase

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 的默認(rèn)配置為 rebase
git pull = git fetch + git merge
執(zhí)行 git pull 命令時(shí),默認(rèn)是用 git merge 來合并代碼的。大家都知道,用 merge 合并代碼的節(jié)點(diǎn)不在一個(gè)分支上,不方便查看節(jié)點(diǎn)信息,所以很多公司是采用 git rebase 來合并代碼的。針對(duì)這種情況,可以在自己的電腦終端,修改 git 的全局配置,將 pull 的默認(rèn)配置改為 rebase。
全局修改 pull 的命令:

git config --global --add pull.rebase true 劃重點(diǎn)?。?!

查看是否修改成功命令:

git config --global -l
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容