Questions about git-push for huge repositories
- From
- Levin Du <zslevin@gmail.com>
- Date
- Sep 6, 2015, 08:16 UTC
- Message-ID
- <CAN6cQGPcGpaXUGu_7aaeJtMbruMocte-5po97vG5r39f=YdTZQ@mail.gmail.com>
Hi all,
I meet with a strange problem:
I've two repositories, with sizes: - A: 6.1G - B: 6G
Both A & B have been 'git gc' with: git reflog expire --expire=now --all git gc --prune=now --aggressive
Since A & B share many common files, to save disk space, I'd like to merge them: (note: branch of A & B are independent, i.e. have no common ancestor.) git clone --bare A C (cd B; git push ../C master:master_b)
Repo C's size has grown to 12G. Doing a 'git gc' again, it drops to 6.2G.
I expect that 'git push' push only new files and commits, which will save lots of space. Yet it turns out I'm wrong. Since Repo A has been published, pushing branch of B will double the repo size, which is impossible for the storage limit.
Any suggestions? Thanks in advance.
Best Regards, Levin Du