git show commit in beyond compare

后端 未结 6 1811
半阙折子戏
半阙折子戏 2021-02-05 06:46

I would like to see a specific commit in Beyond Compare or any other separate diff tool while viewing it via git show. I tried looking at help of git show/difftool/

6条回答
  •  没有蜡笔的小新
    2021-02-05 07:24

    You can also create an alias "showtool" to wrap the call to git difftool:

    set +o histexpand
    git config --global alias.showtool "!sh -c 'if [ -z \$1 ]; then REVISION="HEAD"; else REVISION="\$1"; fi; git difftool \$REVISION~ \$REVISION' -"
    

    .. then you can execute:

    git showtool 81e945b
    

    .. or just

    git showtool
    

    .. as a shortcut for git difftool 81e945b~1 81e945b to show the changes introduced in 81e945b using the configured difftool, or in the second case git difftool HEAD~1 HEAD

提交回复
热议问题