[英]Can I set an alias in git for “pull --rebase”?
我正在使用git使用此命令創建別名:
git config --global alias.pr=pull --rebase
但它提醒我:
error: invalid key: alias.pr=pull
我也嘗試過:
git config --global alias.pr="pull --rebase"
git config --global alias.pr='pull --rebase'
但都不起作用。
什么是正確的命令?
不要在命令中使用equals字符,並在要為其提供別名的內容周圍使用引號,例如:
git config --global alias.pr 'pull --rebase'
或者,您可以通過直接編輯.gitconfig
文件來設置別名。 有關設置包含參數的別名的詳細信息,請參閱此鏈接 。
如果你想永遠rebase
時做pull
:
git config --global pull.rebase true
當您從遠程分支中提取新版本時,基本上git正在進行合並然后快進。 如果您想在合並步驟之前進行rebase,則必須在.git / config或home git配置文件中指定以下配置。
[branch "test-branch"]
remote = origin
merge = refs/heads/test-branch
rebase = true
所以你必須在你想要的任何分支中指定rebase = true
選項。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.