Man*_*ish 21 git git-diff beyondcompare
我希望通过Beyond Compare或任何其他单独的diff工具查看特定的提交git show.我试着看看git show/difftool/config的帮助,却找不到任何东西.有谁知道怎么做?
我已经看过Git Diff with Beyond Compare并配置了Beyond Compare,git difftool但我也希望将它用作工具git show
Man*_*ish 23
我设法用来git difftool查看我通常用来查看的提交git show.
git show $commit翻译成git difftool $commit^ $commit.
上面的命令显示了commit的父($ commit ^)和commit之间的区别.所有这些当然是在使用difftool配置Beyond Compare之后.
jav*_*ett 12
您还可以创建一个别名"showtool"来将调用包装为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' -"
Run Code Online (Sandbox Code Playgroud)
..然后你可以执行:
git showtool 81e945b
Run Code Online (Sandbox Code Playgroud)
.. 要不就
git showtool
Run Code Online (Sandbox Code Playgroud)
..作为git difftool 81e945b~1 81e945b显示81e945b使用配置的difftool时引入的更改的快捷方式,或者在第二种情况下git difftool HEAD~1 HEAD