0

我尝试了各种git diff命令。

从使用实际的提交哈希:

$ git diff e2951679823lkdasdkjn38 7jhlkdjhlakj3kl2jlj2a90 | mate2

要使用两个分支:

$ git diff master develop | mate2

两者都只是启动 Textmate2 但不向我显示我想查看的文件。

我希望能够对我Gemfile.lock在 Textmate 中的最后两次或 3 次提交进行比较。我怎么做?

4

1 回答 1

0

退房mate -h。您可以为 TM2 提供有关您要与-t交换机一起使用的捆绑包的提示。下面比较了两个分支,以 diff 模式将输出传递给 TextMate:

git diff master develop | mate -t source.diff

要仅查看单个路径,请执行以下操作:

git diff master develop -- <paths> | mate -t source.diff

对于许多其他命令(如 git log)来说,这也是相当常见的语法。您可以在git diff 手册页上阅读更多相关信息:

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>
于 2013-12-14T11:39:49.600 回答