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

Re: Help rescuing a repository

From
Pierre Habouzit <madcoder@debian.org>
Date
Jun 11, 2008, 07:46 UTC
Message-ID
<20080611074649.GC28629@artemis.madism.org>
In-Reply-To
<025E3DB6-D0A8-497E-A5EF-9B4011FA3272@vicaya.com>
On Wed, Jun 11, 2008 at 05:04:25AM +0000, Luke Lu wrote:
Show 7 quoted lines
> git rebase --abort, I think, would actually blow away my last commit (I 
> sneaked in) though. git reset --hard to that last commit is probably the 
> right thing to do. The least confusing option would be to update the 
> error message to be a bit more informative, like "Did you change the 
> branch while rebasing? git reset --hard to your last known commit and 
> redo the rebase". Yet another safeguard would be for git commit to check 
> if there is a rebase in progress and warn or abort the commit.
  OTOH the commit you did has been your HEAD for a moment, so it's
easily cherry-pickable from your reflog. So I'd go for the git rebase
--abort route, redo the rebase, and once done, then run git reflog and
find the commit that you want to get back, and cherry-pick it with its
proper reflog name: git cherry-pick HEAD@{nnn}.
-- 
·O·  Pierre Habouzit
··O                                                madcoder@debian.org
OOO                                                http://www.madism.org
Previous: Luke Lu
Message 4 of 4 in “Help rescuing a repository”
  1. Luke LuJun 11, 2008
  2. Linus TorvaldsJun 11, 2008
  3. Luke LuJun 11, 2008
  4. Pierre HabouzitJun 11, 2008

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.