为什么git历史记录命令会出错?

为什么git历史记录命令会出错?,git,Git,根据Kubuntu 18在bitbucket的项目,我需要审查开发过程中对某些文件所做的所有更改 我找到了这根树枝, 但尝试检查resources/js/app.js文件的所有更新时,我遇到了错误: user@projectpath$ git log resources/js/app.js fatal: ambiguous argument 'resources/js/app.js': unknown revision or path not in the working tree. Use

根据Kubuntu 18在bitbucket的项目,我需要审查开发过程中对某些文件所做的所有更改

我找到了这根树枝, 但尝试检查resources/js/app.js文件的所有更新时,我遇到了错误:

user@projectpath$ git log  resources/js/app.js
fatal: ambiguous argument 'resources/js/app.js': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'

user@projectpath$ git diff  resources/js/app.js
fatal: ambiguous argument 'resources/js/app.js': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'

user@projectpath$ git whatchanged  resources/js/app.js
fatal: ambiguous argument 'resources/js/app.js': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
我还尝试运行以下命令:

gitk --follow  resources/js/app.js
但是无效的参数错误。。。 哪种方式有效? 谢谢

Git告诉过你:


如果文件当前未签出,您将需要
--
。否则,它有时是可选的。养成使用它的习惯,以便在它不是可选文件时自动使用它。

此文件是否已提交?
git status
怎么说?
.gitignore
中是否有
*.js
?我希望您理解,您尝试的所有命令都有相同的问题…它们无法识别
资源/js/app.js
。这不是git版本的东西。在这种情况下,git的行为可能不会随着时间的推移而改变。显然,文件
resources/js/app.js
不受Git版本控制。文件是否存在(请尝试
ls resources/js/app.js
)?正如@FantasticMrFox所说,做
git状态
,或者更好的是,
git状态——被忽略
。后者将向您显示由于与您的
.gitignore
文件之一匹配而通常被git忽略的文件。。。。如果
git status--ignored
显示该文件,或
js
resource
子目录,则该文件当前不在git的控制之下。
gitk --follow  resources/js/app.js
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
git log -- resources/js/app.js