我想创建一个git别名来输出具有特定命名约定的diff文件。
我创建了一个如下所示的别名。将git diff运行到HEAD并输出名为Foo.diff的文件
[alias]
diffAlias = diff HEAD > Foo.diff
但是运行这个给了我错误:
$ git diffAlias
fatal: ambiguous argument '>': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
答案 0 :(得分:1)
试试这个
[alias]
diffAlias = !sh -c 'git diff HEAD > foo.diff'