設定 git-pull 以自動執行 rebase 而不是合併
如果你的團隊正在遵循基於 rebase 的工作流程,那麼設定 git 可能是有利的,這樣每個新建立的分支將在 git pull
期間執行 rebase 操作,而不是合併操作。
要設定每個新分支自動變基,請將以下內容新增到 .gitconfig
或 .git/config
:
[branch]
autosetuprebase = always
命令列:git config [--global] branch.autosetuprebase always
或者,你可以將 git pull
命令設定為始終表現為傳遞選項 --rebase
:
[pull]
rebase = true
命令列:git config [--global] pull.rebase true