Created
July 30, 2020 11:48
-
-
Save jgmuchiri/13a05b475f361211a603110608eaf55f to your computer and use it in GitHub Desktop.
Add this to your .bashrc to permanently remove a file from git repo and history
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gitremove(){ | |
echo "Enter file to remove" | |
read FILE | |
git filter-branch --force --index-filter 'git rm --cached --ignore-unmatch $FILE' --prune- | |
empty --tag-name-filter cat -- --all | |
git push origin master -f | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment