2016-03-23 46 views

回答

7

所有文件首先已經COMMITED所以你必須從回購中取出後

enter image description here

更新

沒有變化:

git rm -r --cached .Rproj.user/** 
git commit -m "Removed files...." 

# now add it to the `.gitignore` and the files will be ignored 

補充一點:

.Rproj.user/** 

你需要將其標記爲文件夾。
爲了做到這一點添加2 **以上

enter image description here

描述P.S.

這是一個很酷的鉤子,這將阻止這些類型的文件,當您嘗試添加推動他們到服務器。

What are some more forceful ways than a .gitignore to keep (force) files out of a repo?

+1

不幸的是,它沒有奏效。往上看。 –

+0

我明白了爲什麼,它已經在你的回購中了。首先你必須刪除它: – CodeWizard

+0

'git rm --cached .Rproj.user/**'然後提交更改,git忽略將從這一點捕獲 – CodeWizard