Skip to content

Instantly share code, notes, and snippets.

@lengerfulluse
Last active August 29, 2015 14:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lengerfulluse/b846d14e9b8795763fbc to your computer and use it in GitHub Desktop.
Save lengerfulluse/b846d14e9b8795763fbc to your computer and use it in GitHub Desktop.
fixing for gitignore not working
  1. 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 .
    
  2. To untrack every file that is now in your .gitignore:
    a. First commit any outstanding code changes, and then, run this command:

    git rm -r --cached .

b. This removes any changed files from the index(staging area), then just run:

  git add .  

c. Commit it:

  git commit -m ".gitignore is now working"  

Remember to commit everything you changed before you do this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment