git visual diff between branches

前端 未结 16 2025
独厮守ぢ
独厮守ぢ 2020-12-12 08:35

This answer is great for seeing a visual diff between two files that are checked into git: How do I view 'git diff' output with a visual diff program?

Howev

16条回答
  •  半阙折子戏
    2020-12-12 09:14

    Try "difftool" (assuming you have diff tools setup) - see https://www.kernel.org/pub/software/scm/git/docs/git-difftool.html

    I find name status good for the summary but difftool will iterate the changes (and the -d option gives you the directory view), e.g.

    $ git difftool their-branch my-branch
    
    Viewing: 'file1.txt'
    Launch 'bc3' [Y/n]:
    ...
    

    Or as @rsilva4 mentioned with -d and default to your current branch it is just - e.g. compare to master:

    $  git difftool -d master..
    

    ...and yes - there are many variations - https://www.kernel.org/pub/software/scm/git/docs/git-reset.html

提交回复
热议问题