Remove Unwanted Files From Git History
Here's an example of how to remove every *.pyc file from every commit in Git history. It is adapted from this Git help page.
Rewrite history
Run git filter-branch, forcing (--force) Git to process—but not check out (--index-filter)—the entire history of every branch and tag (--tag-name-filter cat -- --all …
How do you discard unstaged changes in git?
How do you discard unstaged changes in git?
git clean -dfgit checkout -- .
Adding Git version control to web sites
Here's a little script I made to make it easy to put a number of existing web sites residing under /var/www under version control by Git. Regarding security, it is obviously not a good idea to initialize the Git repository directly under the site directory, since from there it …
Ignoring files · GitHub Help · Global .gitignore
Ignoring files · GitHub Help · Global .gitignore
How to import existing GIT repository into another?
Git undo, reset or revert?
Also useful:
git rm -r --cached *
That will recursively remove every file from the index (files staged for commit).