2010-12-08 14 views
2

我輸入以下內容:不能Git的add.gitignore

mkdir project_name 
cd project_name 
git init 
touch .gitignore 
git add .gitignore 

我得到了以下回應:

The following paths are ignored by one of your .gitignore files: 
.gitignore 
Use -f if you really want to add them. 
fatal: no files added 

我找不到任何gitignore文件可能會導致此。有沒有推薦的方法來找出造成問題的原因?

+0

你能檢查'git log .gitignore'或'git status'看看你的倉庫裏有什麼?如果這是一個子文件夾,我會建議運行一個'查找。 -name .gitignore',然後仔細檢查它們... – Matthieu 2010-12-08 18:33:04

回答