Committed a large file which is not needed. Committed a file containing password. Git rm does not remove the file completely form history. Either the size of .git becomes unnecessarily large or sensitive information is still in the repository history.git-filter-branch is your friend. You should have a look at its manual page. I wrote a python script to purge a file or directory from repo history. It can be found here. Pass the filename as -f filename and directory as -d dirname to this script. It will do the rest. It only works on master branch. On other branches, you have to push yourself.Make sure to provide full path of file or directory. I am not sure if it would work on regex.
- How the Heck Do I Use GitHub? (lifehacker.com)
- Source Control with Git (nexcess.net)
- Git Tips From the Pros (net.tutsplus.com)