Last active
April 20, 2016 16:42
-
-
Save pedrokoblitz/382768fc9d83bf5706cf9baad3846b30 to your computer and use it in GitHub Desktop.
remove files from git 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
# remove from git and commit | |
git rm -r dir1/ dir2/ file.1 | |
git commit -m 'remmove stuff' | |
# remove from branch history | |
git filter-branch --index-filter \ | |
'git rm -r --ignore-unmatch --cached dir1/ dir2 file.1' -- 7b30847^.. # last commit BEFORE removing stuff | |
# remove from filesystem | |
rm -rf dir1/ dir2/ file.1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment