Viewing all `git diffs` with vimdiff

后端 未结 4 1216
广开言路
广开言路 2020-12-02 03:19

I setup git diff to wrap into vimdiff, using \"Git Diff with Vimdiff\" as a guide, and it\'s working as expected unless there are many files with changes.

相关标签:
4条回答
  • 2020-12-02 04:09

    For people who want to use another diff tool not listed in git, say with nvim. here is what I ended up using:

    git config --global alias.d difftool -x <tool name>
    

    In my case, I set <tool name> to nvim -d and invoke the diff command with

    git d <file>
    
    0 讨论(0)
  • 2020-12-02 04:10
    git config --global diff.tool vimdiff
    git config --global difftool.prompt false
    git config --global alias.d difftool
    

    Typing git d yields the expected behavior, typing :wq in vim cycles to the next file in the changeset.

    0 讨论(0)
  • 2020-12-02 04:12

    You can try git difftool, it is designed to do this stuff.

    First, you need to config diff tool to vimdiff

    git config diff.tool vimdiff
    

    Then, when you want to diff, just use git difftool instead of git diff. It will work as you expect.

    0 讨论(0)
  • 2020-12-02 04:14
    Git accepts kdiff3, tkdiff, meld, xxdiff, emerge, vimdiff, gvimdiff, ecmerge,
    and opendiff as valid diff tools. You can also set up a custom tool. 
    
    git config --global diff.tool vimdiff
    git config --global diff.tool kdiff3
    git config --global diff.tool meld
    git config --global diff.tool xxdiff
    git config --global diff.tool emerge
    git config --global diff.tool gvimdiff
    git config --global diff.tool ecmerge
    
    0 讨论(0)
提交回复
热议问题