Skip to content

Instantly share code, notes, and snippets.

@jamestrevorlees
Last active October 9, 2016 09:07
Show Gist options
  • Save jamestrevorlees/1df8d0ceeb58d892e27c51b6485a8c20 to your computer and use it in GitHub Desktop.
Save jamestrevorlees/1df8d0ceeb58d892e27c51b6485a8c20 to your computer and use it in GitHub Desktop.
Adding or removing files onto your .gitignore when you are already tracking
Often we have to add or remove files from a gitignore. In order to do so I choose to recache git and this is how I do it:
1. make your .gitignore changes
2. Recache git
cmd: git rm -r --cached .
--> this tells git to remove the cache for all your files that are currently being tracked
3. Add all the files to git again
cmd: git add .
4. Commit this change and push to your remote repos
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment