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

Re: Error "fatal: not a git repository" after auto packing

From
Duy Nguyen <pclouds@gmail.com>
Date
Aug 12, 2014, 15:41 UTC
Message-ID
<CACsJy8A576_OxXNKpsar5DiJ3Z=YsG4DURxL_JceknhRxBjB+g@mail.gmail.com>
In-Reply-To
<CACZXET_qPzBtqJLXBbou+iZ_Muj=VqCBe5qMADN72VScsuHRVQ@mail.gmail.com>

On Tue, Aug 12, 2014 at 5:56 AM, Luke Campagnola <luke.campagnola@gmail.com> wrote:

Show 10 quoted lines
> Greetings,
>
> I have been working happily with git for a couple of years, and ran
> into a mysterious issue today: after running a git-pull during which I
> saw the message "Auto packing the repository for optimum performance".
> I now receive the error "Fatal: not a git repository" when running any
> git commands, and a little investigation revealed that my .git/refs
> directory has gone missing, presumably because the refs were all
> combined into .git/packed-refs. To restore access to the repository,
> all I needed was to `mkdir .git/refs`. Is this a known bug?
Not to me.
> It seems
> like either git should tolerate the absence of a .git/refs directory,
> or the auto packer should not remove it.

I tried to clone from vispy.git, running 'git gc' manually and 'pack-refs' (which should be in charge of removing empty dirs with v1.9.1. Things worked fine. Looked at refs.c:try_remove_empty_parents() as well. Still could not find any bug there.. So no good news. I don't suppose that if you run "git gc" again, it would remove $GIT_DIR/refs one more time?

-- 
Duy
Previous: Luke CampagnolaNext: Dennis Kaarsemaker
Message 2 of 4 in “Error "fatal: not a git repository" after auto packing”
  1. Luke CampagnolaAug 11, 2014
  2. Duy NguyenAug 12, 2014
  3. Dennis KaarsemakerAug 12, 2014
  4. Luke CampagnolaAug 12, 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.