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

Re: how to reduce disk usage for large .git dirs?

From
Olaf Hering <olaf@aepfle.de>
Date
Nov 25, 2014, 14:32 UTC
Message-ID
<20141125143259.GA9794@aepfle.de>
In-Reply-To
<8761ehom8l.fsf@igel.home>
On Fri, Nov 14, Andreas Schwab wrote:
Show 7 quoted lines
> Olaf Hering <olaf@aepfle.de> writes:
> 
> > Even if I do a fresh clone with --bare, the result can not be updated
> > anymore with git fetch. What I'm doing wrong?
> 
> A --bare clone has no connection to its origin (there are no remotes).
> You want a --mirror.

Using --mirror for this purpose is dangerous because it will most likely overwrite changes on the remote side. Fortunately I used 'git push --dry-run origin' and the output was like:

To git://host/repo.git
 + abbrev1..abbrev2 branchA -> branchA (forced update)

Before that I pushed already to the remote repo without realizing where the push goes to.

Looks like using the --bare option for cloning the master and then doing something like "git clone --origin local_bare -b branchA --reference repo-master git://host/repo.git repo-branchA" will work better.

Olaf
Previous: Andreas Schwab
Message 18 of 18 in “how to reduce disk usage for large .git dirs?”
  1. Olaf HeringNov 13, 2014
  2. Fredrik GustafssonNov 13, 2014
  3. Olaf HeringNov 13, 2014
  4. Jakub NarębskiNov 14, 2014
  5. Roger GammansNov 13, 2014
  6. Olaf HeringNov 13, 2014
  7. Duy NguyenNov 13, 2014
  8. Olaf HeringNov 13, 2014
  9. Fredrik GustafssonNov 13, 2014
  10. Johan HerlandNov 13, 2014
  11. Jeff KingNov 13, 2014
  12. Olaf HeringNov 14, 2014
  13. Fredrik GustafssonNov 14, 2014
  14. Olaf HeringNov 14, 2014
  15. Olaf HeringNov 14, 2014
  16. Olaf HeringNov 14, 2014
  17. Andreas SchwabNov 14, 2014
  18. Olaf HeringNov 25, 2014

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.