Re: Questions about git-push for huge repositories
- From
- Levin Du <zslevin@gmail.com>
- Date
- Sep 7, 2015, 03:51 UTC
- Message-ID
- <CAN6cQGNGP+n3L=tuRCymOTWFCnFNsq-tFHkaNm+W=o726mjmmw@mail.gmail.com>
- In-Reply-To
- <CAN6cQGMf089ERn2kZbFpHJ6vyJ4BnjCm-m-E+hQsduH55XFvKw@mail.gmail.com>
I try to use 'git replace --graft' to work aroud this. Here's the process: cd A fetch ../B master:master_b git replace --graft master_b master_a # now master_b's parent is master_a
# do a filter-branch to make the stone solid git filter-branch --tag-name-filter cat -- master_a..master_b
# prune all the old refs and do gc git replace -d <origin_commit_of_master_b> git update-ref -d refs/original/refs/heads/master_b git reflog expire --expire=now --all git gc --prune=now --aggressive
And I'd like to make master_b look orphan, so using 'git replace' again: git replace --graft master_b git log master_b # only show one commit, fine git push /path/to/public/A master_b # small amount of data pushed du -hs /path/to/public/A # 6.2 GiB
All are fine, except when I want to push the replace ref: git push /path/to/public/A 'refs/replace/*'
It pushes 6 GiB data again.
So right now, 'git replace --graft master_b' needs to run by users if they need a tidy history view.