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

Re: About detached heads

From
Matthieu Moy <matthieu.moy@imag.fr>
Date
Mar 14, 2008, 10:48 UTC
Message-ID
<vpq1w6dvaxe.fsf@bauges.imag.fr>
In-Reply-To
<9A4AC53D-BCFA-4BEE-BD53-AA7F29781454@wincent.com>
Wincent Colaiuta <win@wincent.com> writes:
Show 13 quoted lines
> El 14/3/2008, a las 10:46, Geoff Russell escribió:
>
>> This should be simple! I have a series of commits:
>>
>>           1---2---3---4---5
>>
>> I want to go back to 3 but not branch, so I want
>>
>>           1---2---3---4---5---3
>
> How about?
>
>   git cherry-pick the-sha-1-id-of-commit-3

Correct me if I'm wrong, but I believe this will try to re-apply commit 3 (probably a no-op since commit 3 is already in the history, perhaps tons of conflicts if 4 and 5 touched the same pieces of code).

The OP wants to keep commit 3, and to revert commits 4 and 5. As mentionned in other messages, either "git revert" 4 and 5, or just commit a new revision with the same tree as 3 had.

-- 
Matthieu
Previous: Wincent ColaiutaNext: Wincent Colaiuta
Message 5 of 22 in “About detached heads”
  1. Geoff RussellMar 14, 2008
  2. Jonathan del StrotherMar 14, 2008
  3. David KågedalMar 14, 2008
  4. Wincent ColaiutaMar 14, 2008
  5. Matthieu MoyMar 14, 2008
  6. Wincent ColaiutaMar 14, 2008
  7. Jakub NarebskiMar 14, 2008
  8. Sergei OrganovMar 14, 2008
  9. Adam PiatyszekMar 14, 2008
  10. Chris ShoemakerMar 14, 2008
  11. Rafael Garcia-SuarezMar 14, 2008
  12. Nicolas PitreMar 14, 2008
  13. Jakub NarebskiMar 14, 2008
  14. Linus TorvaldsMar 14, 2008
  15. Björn SteinbrinkMar 14, 2008
  16. Linus TorvaldsMar 14, 2008
  17. Jakub NarebskiMar 14, 2008
  18. SeanMar 14, 2008
  19. Geoff RussellMar 14, 2008
  20. Jakub NarebskiMar 15, 2008
  21. Nicolas PitreMar 15, 2008
  22. Geoff RussellMar 15, 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.