2010-08-10 79 views
5

每次我做git狀態都有這個文件夾顯示爲未跟蹤。git仍然未追蹤追加

$ git status 
# On branch master 
# Untracked files: 
# (use "git add <file>..." to include in what will be committed) 
# 
#  src/error/ 
nothing added to commit but untracked files present (use "git add" to track) 

即使在SRC /錯誤做git add .git commit -a文件夾後一直顯示爲未跟蹤。其他非分頁文件每次都提交,只有這個文件夾不斷給出問題。也git不報告任何錯誤。這裏可能是什麼問題?

+2

你試過'git add src/error /'? – strager 2010-08-10 07:38:08

+0

我試過,它沒有工作我有一個文件在該文件夾中,我也嘗試直接添加該文件也無法正常工作。 – slayerIQ 2010-08-10 07:42:20

+0

您是否嘗試在src/error下添加特定文件?你在.gitignore文件中有什麼? – David 2010-08-10 07:55:11

回答

5

我發現問題和解決方案,這是發生了什麼事:被稱爲

首先SRC /錯誤的src /錯誤,當我改變了本地文件夾名被改變的情況下,但在Git中仍然COMMITED爲SRC /錯誤。 Windows是不區分大小寫的,所以我做的是刪除文件夾提交併再次用右邊的外殼添加它。

+0

謝謝,這幫了我一把! – 2013-02-13 11:41:52

1

那是空的文件夾,如果這樣是正常的,看here

+0

沒有文件夾不是空的。 – slayerIQ 2010-08-10 07:43:06

1

我試圖在Windows 7控制檯下面和它的工作,即它並沒有表現出\src\error\爲未跟蹤。

C:\t>dir 
Volume in drive C is BLAH 
Volume Serial Number is 2ECA-CB88 

Directory of C:\t 

10.08.2010 17:56 <DIR>   . 
10.08.2010 17:56 <DIR>   .. 
       0 File(s)    0 bytes 
       2 Dir(s) 59'844'902'912 bytes free 

C:\t>mkdir .\src\error 

C:\t>copy con: .\src\error\text.txt 
blah^Z 
     1 file(s) copied. 

C:\t>git init 
Initialized empty Git repository in C:/t/.git/ 

C:\t>git add .\src\error\* 

C:\t>git status 
# On branch master 
# 
# Initial commit 
# 
# Changes to be committed: 
# (use "git rm --cached <file>..." to unstage) 
# 
#  new file: src/error/text.txt 
# 

這並不回答您的問題,但我認爲這可能有助於查看完整的分步示例。