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

Asked

Viewed 316 times

1

I would like to remove a file or directory that was sent to the Git repository erroneously, but without removing it from my local files. Which command git executes such an action?

1 answer

1


Pass the parameter --cached to the git rm:

git rm --cached arquivo.txt

For directories, recursively remove with -r:

git rm --cached -r diretorio

Browser other questions tagged

You are not signed in. Login or sign up in order to post.