My central repository is stored on an 8GB USB stick. I accidentally committed some big files, so the repository doesn’t fit on the stick anymore. Is there a way to correct this situation?
My central repository is stored on an 8GB USB stick. I accidentally committed some
Share
I voted up catchyifyoutry’s answer since he’s got the steps you’ll probably use, but here’s a handy list.
First, though, a reminder. If you’ve already pushed this repository somewhere semi-public, and people have pulled the repository, then none of the tips below will work. When next they push and you pull you’ll get the original changesets back in their unmodified form. Your only recourse is to talk to each person who has a clone and ask them to delete it and re-clone. That said, on to the list:
Ways to obliterate files you committed on accident
hg rollbackwill act as one level undohg clone -r -N repo-with-too-much repo-with-N-fewer changesets# example:hg clone -r -2 big-repo small-repohg convert --filemap myfilemap.txt too-big-repo new-repoIn that last case
myfilemap.txthas in it:Notes:
clone -rcase technically asks for the minimal clone that could include revision tip-N, which if you have a branchy repo. Additionallpull -rlines (one per head) will be necessary to pull over other non-linear history.hg convertsolution the hashcode of every modified changeset and all of their descendants will be modified.