Monday, 23 September 2013

Remove File History In GIT

Problem :


If you have a connection config file , where you have your admin password or other sensitive information . If you commit this file accidently in git , it will show in the history , even if you remove it later . To Complete remove the committed file from git , you need to run this command
git filter-branch --force --index-filter "git rm --cached --ignore-unmatch ${full path to your file}" --prune-empty --tag-name-filter cat -- --all
and push the changes to remote branch . Now all the history related to this file will be deleted . Post Comments and Suggestions !!