2016-02-19 127 views
0

我嘗試了一切,但不管我做了什麼工作區文件(workspace.xml)不斷返回併爲我和我的團隊運行我的git項目。無法從我的git中刪除workspace.xml

這裏是香港專業教育學院採取的步驟:

$ echo '.idea' >> .gitignore 
$ git rm -r --cached .idea 
$ git add .gitignore 
$ git commit -m 'added idea' 
$ git push 

現在推後,我進入PHPStorm再次和我的.gitignore看起來是正確的:

.idea/ 
user_resources/* 
img/* 
app_server/user_resources/* 
app_server/uploads/* 
app_server/database.json 
app_server/custom_modules/config.json 
app_server/cacheObjects/* 
organizationConfig.json 

然而,一旦我嘗試提交工作區文件再次被添加並且想要被提交。 enter image description here 我做錯了什麼?

回答

0

git rm --cached用於從索引中刪除東西,而不是工作樹。使用git rm -r .idea

從git的文檔

--cached
使用此選項unstage只有從索引中刪除路徑。工作樹文件,無論是否修改,都將被單獨保留。

+0

我試過這個可悲的這沒有做的伎倆仍然是同樣的結果 –