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

Re: Corrupted git repository?

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 15, 2011, 20:00 UTC
Message-ID
<7vk4h1nk3x.fsf@alter.siamese.dyndns.org>
In-Reply-To
<AANLkTimMon7ztbyT26YhotiZ=jd=QpNTvOkPCKwHg+e_@mail.gmail.com>
Piotr Krukowiecki <piotr.krukowiecki.news@gmail.com> writes:
Show 5 quoted lines
> it looks like my git repository got corrupted today.
>
> git status shows no changes,
> git cherry-pick says "error: Your local changes to the following files
> would be overwritten by merge:",
with some paths, or without naming any path?
> git fsck starts checking objects but hangs on one "Checking tree"

I take it that you are talking about "git fsck -v". Is it really "hangs", or just "takes a long time"? You mentioned that a clone is expensive so I am guessing that your repository has some huge trees or objects in general.

The details you gave in your message are a bit sketchy to give you an exact diagnosis, but if "cherry-pick" stops with the above message and tells you the names of files that are not tracked in your current branch, I don't see there is anything unusual going on. You have these files with random contents that git does not know about, and git is refusing to lose their contents by overwriting them during the cherry-pick.

After making sure that they are indeed untracked paths, if you think you can remove them (or move them away), first do so and retry cherry-pick, and then everything should be Ok.

Previous: Piotr KrukowieckiNext: Piotr Krukowiecki
Message 2 of 5 in “Corrupted git repository?”
  1. Piotr KrukowieckiFeb 15, 2011
  2. Junio C HamanoFeb 15, 2011
  3. Piotr KrukowieckiFeb 16, 2011
  4. Johannes SixtFeb 16, 2011
  5. Piotr KrukowieckiFeb 16, 2011

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.