git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Questions about git-push for huge repositories

From
LDLevin 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.

Previous: Levin DuNext: Levin Du
Message 4 of 9 in “Questions about git-push for huge repositories”
  1. Levin DuSep 6, 2015
  2. Junio C HamanoSep 6, 2015
  3. Levin DuSep 7, 2015
  4. Levin DuSep 7, 2015
  5. Levin DuSep 8, 2015
  6. Jeff KingSep 8, 2015
  7. Junio C HamanoSep 8, 2015
  8. Jeff KingSep 8, 2015
  9. Jeff KingSep 8, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.