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

1.5.0.rc0.gf4bf2: "git --bare gc" in bare repo deletes all!

From
Horst H. von Brand <vonbrand@inf.utfsm.cl>
Date
Jan 2, 2007, 15:17 UTC
Message-ID
<200701021517.l02FHDxr009615@laptop13.inf.utfsm.cl>
I did:
  mkdir M
  cd M
  git --bare init-db
  git --bare fetch git+ssh://localhost/SomeRepo
This got the (correct) 21 (loose) objects. OK, cleanup:
  git --bare gc
this gives:
  Generating pack...
  Done counting 0 objects.
  Nothing new to pack.
and the objects are gone, no pack there.
Same thing happens with plain "git gc". Not very nice...

Besides, you can "git --bare pull ...", and get a mishmash of repo + checked out files, this should be forbidden. Also, "git status" reports a bunch of repo files as untracked, "git ls-files" shows nothing at all. I.e., handling of bare repos needs a workover.

-- 
Dr. Horst H. von Brand                   User #22616 counter.li.org
Departamento de Informatica                    Fono: +56 32 2654431
Universidad Tecnica Federico Santa Maria             +56 32 2654239
Casilla 110-V, Valparaiso, Chile               Fax:  +56 32 2797513
Message 1 of 1 in “1.5.0.rc0.gf4bf2: "git --bare gc" in bare repo deletes all!”
  1. Horst H. von BrandJan 2, 2007

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.