如何解決以下情況:Git的報告未經跟蹤的.gitignore文件,不存在
$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
Untracked files:
(use "git add <file>..." to include in what will be committed)
htdocs/files/.gitignore
nothing added to commit but untracked files present (use "git add" to track)
$ git rm htdocs/files/.gitignore
fatal: pathspec 'htdocs/files/.gitignore' did not match any files
htdocs/files
下.gitignore
文件實際上不存在:
$ cd htdocs/files/
$ ls -ls
total 0
0 drwxr-xr-x 3 Trejder Administ 0 Jun 2 23:53 audios
0 drwxr-xr-x 3 Trejder Administ 0 Jun 2 23:53 files
0 drwxr-xr-x 3 Trejder Administ 0 Jun 2 23:53 photos
0 drwxr-xr-x 3 Trejder Administ 0 Jun 2 23:53 videos
(有,然而,.gitignore
文件在每個列出的文件夾下,但我懷疑,這個問題在這種情況下)
我不知道,爲什麼git有關於不存在的任何記錄htdocs/files/.gitignore
?如何解決這個問題?
'ls -ls'命令不會顯示.gitignore文件。使用'ls -lsa'來驗證沒有.gitignore。 – fiveclubs
你不能'git rm'未跟蹤的文件。你只會「嗯」。 – hobbs