为什么git diff无法处理子目录中的更改?

时间:2016-02-24 20:10:37

标签: git-diff subdirectory

为什么git diff无法处理子目录中的更改?

当我执行git diff *c并且C文件位于子目录中时,git会输出错误消息。

 $ git diff *c                                                      
 fatal: ambiguous argument '*c': unknown revision or path not in the
 working tree. Use '--' to separate paths from revisions, like
 this: 'git <command> [<revision>...] -- [<file>...]'

使用git diff来列出子目录中的更改需要什么选项?

1 个答案:

答案 0 :(得分:1)

看起来命令缺少引号而且它们不是可选的:

   $ git diff -- '*.c'