我學過how to exclude an entire directory in git(將一行bin/
添加到.gitignore
)。我已經學會how to ignore files "after the fact"(即它們已被添加之後,GIT):添加後從Git倉庫中忽略目錄
git rm --cached <filename>
如何忽略整個目錄(例如bin/
)後它已被添加到一個Git回購?
我試圖git rm --cached bin/
但我收到了錯誤:
fatal: pathspec 'bin/' did not match any files
當我試圖(在根目錄下,其中存在的.git)git rm --cached MyProj/bin/
錯誤是不同的:
fatal: not removing 'MyProj/bin/' recursively without -r
什麼這是否意味着我現在需要提交和/或分支它?
請注意我答案中的'-r'標記。你必須使用'遞歸':) – Nic
@melee它的工作!但是現在我有另外一個問題。查看更新。 :) – WinWin