Why does git mergetool open 4 windows in vimdiff? (I'd expect 3)

前端 未结 5 1557
北荒
北荒 2021-01-30 14:28

When I met a conflict, I tried to use git-mergetool to solve it. I typed:

>git mergetool -t vimdiff

It opened vimdiff

5条回答
  •  走了就别回头了
    2021-01-30 14:43

    Modifying a bit the commands from this page:

    git config --global mergetool.vimdiff3.cmd 'vim -f -d "$LOCAL" "$MERGED" "$REMOTE"'
    git config --global merge.tool vimdiff3
    
    • 'Merged' would be your working copy.
    • 'Local' the file that is in the branch you are trying to make the changes
    • 'Remote' the file from the branch you are trying to merge with.

    And then you execute the command: git mergetool.

    Note: I use fugitive also and highly recommend it.

提交回复
热议问题