How do I prevent an automerge using Git?

前端 未结 5 1463
孤独总比滥情好
孤独总比滥情好 2020-11-28 20:47

I am trying to merge a local branch into the master branch without having Git to do an automerge. I would like to “hand pick” what I would like to be merged into master.

5条回答
  •  迷失自我
    2020-11-28 21:46

    For vim & vim-fugitive users:

    Add the following to ~/.gitconfig

    [difftool "fugitive"]
      cmd = vimdiff $LOCAL $MERGED $REMOTE
      trustExitCode = false
      keepBackup = false
    

    Now use Fugitive for a 3 way diff

    $ git checkout master
    $ git difftool -t fugitive somebranch HEAD
    

    Note on $LOCAL, $MERGED, $REMOTE:

    $LOCAL The file on the branch where you are merging; untouched by the merge process when shown to you

    $MERGED The partially merged file, with conflicts; this is the only file touched by the merge process and, actually, never shown to you in meld

    $REMOTE The file on the branch from where you are merging; untouched by the merge process when shown to you

提交回复
热议问题