
gitk
with this tool, find the revision where your Videos come from. Then grab the commit-id (sha1 hash) of the commit just before. Let's say you messed up on commit deadbeef and that cafebabe was your commit just before.
the command we want to execute on every commit between cafebabe and now is
git rm --ignore-unmatch -f Videos/*
The way to travel through time on cafebabe..HEAD to enforce that is
git filter-branch --tree-filter "git rm --ignore-unmatch -f Videos/*" cafebabe..HEAD
I bet you want to update gitk's view and explore commits to check all signs of your videos are indeed gone. Good.
Now, let's really cover our tracks:
mv .git/refs/original /tmp/refs-original-git
git reflog expire --expire=now --all
git gc --prune=nowgit gc --prune=now --aggressive
If you were lucky and realised your mistake before the push, you're now done. If you had it pushed to the master repository, you still need to push these fixes ahead:
git push -f
And if you have a second clone of the master (at home?) where the videos still exist and that you want it as clean as the master,
git pull --rebase --verbose

No comments:
Post a Comment