Which version of the git file will be finally used: LOCAL, BASE or REMOTE?

前端 未结 8 1329
故里飘歌
故里飘歌 2020-11-28 17:39

When there\'s a collison during git merge, I open a mergetool called Meld. It opens three files LOCAL, BASE and REMOTE. As I\'ve read LOCAL is my local branch,

相关标签:
8条回答
  • 2020-11-28 18:21

    I found that none of the default files shown was being saved. meld was showing $LOCAL, $REMOTE and $BASE by default. To make it work, I needed to make meld show $MERGED instead of $BASE. Putting this in my ~/.gitconfig fixed it for me:

    [merge]
            tool = mymeld
    [mergetool "mymeld"]
            cmd = meld "$LOCAL" "$MERGED" "$REMOTE"
    

    I'm using Arch, with:

    $ git --version
    git version 1.8.2
    $ meld --version
    meld 1.7.1
    
    0 讨论(0)
  • 2020-11-28 18:24

    Please see Saad's answer for the correct answer.

    With meld 1.8.1 on Ubuntu I was getting the

    wrong number of arguments supplied to --diff

    and adding the --output before $MERGED fixed it for me:

    [mergetool "mymeld"]
    cmd = meld --diff $BASE $LOCAL --diff $BASE $REMOTE --diff $LOCAL $BASE $REMOTE --output $MERGED
    
    0 讨论(0)
提交回复
热议问题