Make git pull --rebase preserve merge commits

后端 未结 3 1498
一个人的身影
一个人的身影 2020-12-05 14:49

git pull --rebase removes unpushed merge commits. Is there a way to make it preserve them?

Say my history looks like—

A
| \\ 
B  H
|  |
         


        
3条回答
  •  情书的邮戳
    2020-12-05 15:41

    Simply:

    git pull --rebase=preserve
    

    From the docs:

    When set to preserve, rebase with the --preserve-merges option passed to git rebase so that locally created merge commits will not be flattened.

提交回复
热议问题