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

Re: Losing branches (whee, data loss)

From
JHJan Hudec <bulb@ucw.cz>
Date
May 16, 2007, 06:14 UTC
Message-ID
<20070516061449.GA25273@artax.karlin.mff.cuni.cz>
In-Reply-To
<464A9C9B.70904@garzik.org>
On Wed, May 16, 2007 at 01:54:35AM -0400, Jeff Garzik wrote:
Show 21 quoted lines
> Lars Hjemli wrote:
> >On 5/16/07, Jeff Garzik <jeff@garzik.org> wrote:
> >>[jgarzik@pretzel libata-dev]$ git branch -m upstream-fixes tmp
> >>error: Could not open config file!
> >>fatal: Branch rename failed
> >
> >This should have been fixed in v1.5.1.1, what version do you run?
> 
> [jgarzik@core ~]$ rpm -q git-core
> git-core-1.5.0.6-1.fc6
> 
> 
> >>[jgarzik@pretzel libata-dev]$ git-branch -m upstream-fixes tmp
> >>fatal: A branch named 'tmp' already exists.
> >>
> >>[jgarzik@pretzel libata-dev]$ git branch -D tmp
> >>Deleted branch tmp.
> >
> >Could you try to run "git log -g" and see if it finds your lost branch?
> 
> Doesn't seem to..
And does the .git/logs/refs/heads/upstream-fixes still exist?

If it does, than revspec upstream-fixes@{1} would still work, so you can check it out, re-create the branch and update the ref (git update-ref).

If it does not, as last resort you'd have to git fsck --unreachable (this gives you all things that are not reachable from any ref), filter out only commit objects and than remember which one should have been on that branch after reading it's log, date and changes.

--------------------------------------------------------------------------------
                  				- Jan Hudec `Bulb' <bulb@ucw.cz>
Previous: Jeff GarzikNext: Jeff Garzik
Message 4 of 10 in “Losing branches (whee, data loss)”
  1. Jeff GarzikMay 16, 2007
  2. Lars HjemliMay 16, 2007
  3. Jeff GarzikMay 16, 2007
  4. Jan HudecMay 16, 2007
  5. Jeff GarzikMay 16, 2007
  6. Junio C HamanoMay 16, 2007
  7. Lars HjemliMay 16, 2007
  8. Junio C HamanoMay 16, 2007
  9. Junio C HamanoMay 16, 2007
  10. Jeff GarzikMay 16, 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.