Skip to content

Instantly share code, notes, and snippets.

@yannvery
Last active August 29, 2015 13:59
Show Gist options
  • Select an option

  • Save yannvery/10738310 to your computer and use it in GitHub Desktop.

Select an option

Save yannvery/10738310 to your computer and use it in GitHub Desktop.
Applying .gitignore file on existing repository

After editing .gitignore to match the ignored files, to see the files that are included in the exclude lists, you can do :

git ls-files -ci --exclude-standard

After that to remove them from the repository (without deleting them from disk), you can then do

git ls-files -ci --exclude-standard -z | xargs -0 git rm --cached
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment