Skip to content

Instantly share code, notes, and snippets.

@dsaiztc
Created May 28, 2017 15:05
Show Gist options
  • Save dsaiztc/589c469224530b6de708522a868939f3 to your computer and use it in GitHub Desktop.
Save dsaiztc/589c469224530b6de708522a868939f3 to your computer and use it in GitHub Desktop.
Remove a file from a Git repository without deleting it from the local filesystem https://stackoverflow.com/questions/1143796/remove-a-file-from-a-git-repository-without-deleting-it-from-the-local-filesyste
git rm --cached mylogfile.log

For a directory:

git rm --cached -r mydirectory
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment