Skip to content

Instantly share code, notes, and snippets.

@jamescmartinez
Created December 10, 2012 07:38
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 jamescmartinez/4249068 to your computer and use it in GitHub Desktop.
Save jamescmartinez/4249068 to your computer and use it in GitHub Desktop.
Run this script to have your git repo reflect your new (or newly updated) .gitignore file
#!/bin/bash
# Please be aware to commit all your changes before; YOU WILL LOSE ALL CHANGES SINCE LAST COMMIT!
git rm -r --cached . # This removes everything from the index.
git add . # Add everything back using new .gitignore
git commit -m ".gitignore is now working" # Commit it!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment