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

unmerging feature branches

From
MKmartin f krafft <madduck@madduck.net>
Date
Oct 23, 2007, 15:24 UTC
Message-ID
<20071023152445.GA10070@piper.oerlikon.madduck.net>
Dear list,

Let's say I developed a feature Foo on a branch off master, and at some point I merged it back into master (commit M) and published the repo. Since M, a number of commits have been made onto master.

Now I woul like to undo the merge.

I could rebase (M+1)..master onto M^ (on the former master branch), but that would orphan the commits between the merge point and the tip of master, which others are tracking.

I'd love to have git-revert, but that cannot undo a multi-parent commit.

I could git-revert every commit on the feature branch between the branch point and the merge point, even squash them into a single commit, but that is a lot of work.

Are there any other methods? Is it conceivable to let git-revert revert a merging commit if you tell it somehow which of the two (or more) parents are the ones you want undone, meaning that you'd like to keep the others?

-- 
martin | http://madduck.net/ | http://two.sentenc.es/
 
"a man who does not realise
 that he is half an animal
 is only half a man."
                                                    -- thornton wilder
 
spamtraps: madduck.bogus@madduck.net
Next: Matthieu Moy
Message 1 of 16 in “unmerging feature branches”
  1. martin f krafftOct 23, 2007
  2. Matthieu MoyOct 23, 2007
  3. Linus TorvaldsOct 23, 2007
  4. martin f krafftOct 23, 2007
  5. Linus TorvaldsOct 23, 2007
  6. martin f krafftOct 23, 2007
  7. Linus TorvaldsOct 23, 2007
  8. martin f krafftOct 23, 2007
  9. Linus TorvaldsOct 23, 2007
  10. Linus TorvaldsOct 23, 2007
  11. Alejandro Martinez RuizOct 31, 2007
  12. martin f krafftOct 31, 2007
  13. Linus TorvaldsOct 31, 2007
  14. Junio C HamanoOct 23, 2007
  15. Linus TorvaldsOct 23, 2007
  16. revert/cherry-pick: work on merge commits as wellJunio C Hamano, Oct 23, 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.