我已经 fork 并克隆了一个仓库来进行贡献。我在命令行中创建了一个新分支,并创建了一个名为 'ansible.cfg' 的文件,但在运行 git status
时它没有显示出来。经过尝试,甚至一个名为'a.cfg'的文件也不会在 git status 中显示:
$ git status
On branch add-selenium-grid
nothing to commit, working directory clean
$ touch tests/ui/a.txt tests/ui/a.cfg
$ git status
On branch add-selenium-grid
Untracked files:
(use "git add <file>..." to include in what will be committed)
tests/ui/a.txt
nothing added to commit but untracked files present (use "git add" to track)
$ ls tests/ui/a.*
tests/ui/a.cfg tests/ui/a.txt
我对git还比较陌生,但这似乎很基础,让我无所适从。
touch a.cfg
,它出现在 git status 中,但是tests/ui/a.cfg
没有出现在状态中。 - joeglin2000git check-ignore -v tests/ui/a.cfg
命令,查看是什么导致它不再提及a.cfg
(如果你的 Git 版本不太旧,支持check-ignore -v
命令)。 - torektests/ui/.gitignore
文件,其中包含一个*.cfg行。谢谢! - joeglin2000