Skip to content

Instantly share code, notes, and snippets.

@mycargus
Created March 8, 2016 18:14
Show Gist options
  • Select an option

  • Save mycargus/3f9b401ab7e5af6b496a to your computer and use it in GitHub Desktop.

Select an option

Save mycargus/3f9b401ab7e5af6b496a to your computer and use it in GitHub Desktop.
# To untrack a single file that has already been added/initialized to your
# repository, i.e., stop tracking the file but not delete it from your system use:
git rm --cached filename
# To untrack every file that is now in your .gitignore:
# First commit any outstanding code changes, and then, run this command:
git rm -r --cached .
# This removes any changed files from the index(staging area), then just run:
git add .
# Commit it:
git commit -m ".gitignore is now working"
#To undo `git rm --cached filename`, use `git add filename`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment