How to remove a file from a Git repository without deleting it locally?

1

I'd like to remove a file or directory that was sent to the Git repository erroneously, but without removing it from my local files. What command git performs such action?

    
asked by anonymous 31.05.2015 / 17:52

1 answer

1

Pass the --cached parameter to git rm :

git rm --cached arquivo.txt

For directories, remove recursively with -r :

git rm --cached -r diretorio

    
31.05.2015 / 17:52