簡體   English   中英

我想使用簡單的 git 合並而不是 git rebase,有哪些區別?

[英]I would like to use simple git merge instead of git rebase, which are the differences?

在我執行git pull upstream master命令后,“git”建議我先解決沖突,然后git add file ,然后再添加git rebase --continue

但是,我不想使用 git rebase,我更喜歡 git 合並,這對我來說似乎更干凈。 有什么建議嗎?

看起來您的 git 配置告訴使用rebase on pull ,這可以解釋為什么您的git pull開始了rebase而不是merge


  • 要停止當前的rebase並改用merge ,您可以運行:
git rebase --abort         # aborts the rebase, and resets to the original commit
git merge origin/mybranch  # merge the remote branch
  • 如果要檢查pull設置,請運行:
git config --show-origin --get pull.rebase

# if you see that the setting is global, and you want to drop it :
git config --global --unset pull.rebase
# if you want to disable it just on that local repository :
git config pull.rebase false
  • 您也可以保持pull設置不變,並使用fetch ,然后是mergerebase
git fetch

# after inspecting the remote, run either :
git merge @{u}
# or
git rebase @{u}

# '@{u}' is a shortcut for "the upstream branch of the current branch"

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM