'git replace' and pushing
- From
Cory Fields <foss@atlastechnologiesinc.com>
- Date
- Nov 24, 2010, 04:33 UTC
- Message-ID
- <AANLkTinzPCeCJ486cysmk981HE61=dv9MS7E8Ap4rQ5r@mail.gmail.com>
I am having some trouble understanding how a replaced object (commit) should behave when pushed to a remote repo. Here's my scenario:
We are moving from svn to git. Our svn repo is huge, and most of the history is useless. To save space, I would like to do a 50/50 split so that when the repo is cloned, 50% is seen by default, and the historical 50% can be seen by fetching the replacement history. I've done this by creating a phony snapshot at 3 then using a 'replace' to put the others on top. The history is purely linear.
1---2---3---4---5 \---4---5
When the replacement is in place, the repo is half size (commit-wise) as expected. The problem is that 'git push' does not honor the replace. So when I push, all objects go with it, which defeats the purpose. The only way that seams to work is doing a filter-branch and replacing the other way.
Is this by design? I would really like a way to split the repo without breaking hashes for the developers that have already begun using git svn.
Thanks, Cory