我尝试了各种git diff
命令。
从使用实际的提交哈希:
$ git diff e2951679823lkdasdkjn38 7jhlkdjhlakj3kl2jlj2a90 | mate2
使用两个分支:
$ git diff master develop | mate2
两者都只是启动Textmate2,但没有显示我想看到的文件。
我希望能够在我的Gemfile.lock
上对Textmate中的最后两次或三次提交做差异。我该怎么做?
答案 0 :(得分:0)
结帐mate -h
。您可以通过-t
开关向TM2提供要使用的捆绑包的提示。下面比较两个分支,以diff模式将输出管道传输到TextMate:
git diff master develop | mate -t source.diff
要仅查看单个路径,请执行以下操作:
git diff master develop -- <paths> | mate -t source.diff
这是许多其他命令的相当常见的语法(如git log)。您可以在git diff manpage上了解更多相关信息:
git diff [options] [<commit>] [--] [<path>…]
git diff [options] --cached [<commit>] [--] [<path>…]
git diff [options] <commit> <commit> [--] [<path>…]
git diff [options] <blob> <blob>
git diff [options] [--no-index] [--] <path> <path>