From: Levin Du Date: Mon, 07 Sep 2015 03:51:52 GMT Subject: Re: Questions about git-push for huge repositories Message-ID: In-Reply-To: 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 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.