0
我已經分叉並克隆了一個存儲庫,以便爲它做出貢獻。在命令行中,我創建了一個新分支,並創建了一個名爲'ansible.cfg'的文件,但在運行git status
時不會顯示。玩弄甚至一個文件「a.cfg」後不git的狀態顯示:新文件沒有在git狀態下顯示
$ 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,但這似乎如此基本,我不知所措。
檢查的.gitignore文件,看看是否有與* .CFG – buff
有一條線在.gitignore中沒有* .cfg。另外,我只是嘗試了'touch a.cfg',它顯示在git狀態中,但是'tests/ui/a.cfg'不會顯示在狀態中。 – je1910
嘗試使用'git check-ignore -v tests/ui/a.cfg'來查看是什麼使得它關閉了'a.cfg'(如果你的Git不是太老的話不能有'check-ignore -v')。 – torek