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

Re: Add 'sane' mode to 'git reset'

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 4, 2008, 02:03 UTC
Message-ID
<7vk5ag7l3w.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<alpine.LFD.2.00.0812031634520.3256@nehalem.linux-foundation.org>
Linus Torvalds <torvalds@linux-foundation.org> writes:
Show 10 quoted lines
> On Wed, 3 Dec 2008, Junio C Hamano wrote:
>> 
>> The recovery procedure I would use in such a case (and I rarely pull while
>> managing git.git even though I do so in my day job) would be:
>> 
>> 	$ git checkout -b this-needs-more-work
>>      $ git checkout master
>
> No, that won't work. The second 'git checkout' does nothing, since 
> 'master' still has all the broken code in it.
Yeah, brain-o.  I should have said
	git checkout -b needs-more-work
        git branch -f master master~$n
        git checkout master
or something like that.
Previous: Junio C Hamano
Message 8 of 8 in “Add 'sane' mode to 'git reset'”
  1. Linus TorvaldsDec 1, 2008
  2. Avery PennarunDec 1, 2008
  3. Jakub NarebskiDec 1, 2008
  4. Linus TorvaldsDec 1, 2008
  5. Junio C HamanoDec 3, 2008
  6. Linus TorvaldsDec 4, 2008
  7. Document "git-reset --merge"Junio C Hamano, Dec 4, 2008
  8. Junio C HamanoDec 4, 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.