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

Re: Moving commits from one branch to another (improving my git fu!)

From
Mandeep Sandhu <mandeepsandhu.chd@gmail.com>
Date
Oct 22, 2013, 06:11 UTC
Message-ID
<CAC+QLdQADFPvuZ6VcDqSUYSd_sn54LK=YLqaW3U2DC1MbnsM+g@mail.gmail.com>
In-Reply-To
<alpine.DEB.2.00.1310220647400.13299@ds9.cixit.se>
Show 7 quoted lines
>> $ git rebase dev stable topicA
>> (this was suggested in the manpage as well).
>
>
> I guess you also had an "--onto" in there, as the above would throw a syntax
> error. As long as the branches are in order, I cannot see how that wouldn't
> do what you wanted.
Yes, you're right. There was "--onto" there.

The only problem is that there were a LOT of conflicts when I ran this cmd in places which have nothing to do with my commit. And as I said, dev is vastly different from stable.

Show 8 quoted lines
>
> However, the easiest way to do it would probably just to run:
>
>  git checkout topicA
>  git rebase dev
>
> As long as "dev" already contains all the commits in "stable", that should
> work fine. If not, then you would need something more complicated.

I don't think thats the case currently. People commit bug-fixes to 'stable' (from which a release will be made later) and all new and experimental stuff is tried on 'dev'. So there's a lot in 'dev' that's not there in 'stable'.

Show 5 quoted lines
>
> Another way to do it would be to use cherry-pick on a new branch:
>
>  git checkout -b new_topicA dev
>  git cherry-pick stable..topicA

Hmmm...this looks safe to do. If I do "git log stable..topicA" it should only show my commits made on top of stable, right? Or I can even mention the commit SHA here?

Thanks, -mandeep

>
> --
> \\// Peter - http://www.softwolves.pp.se/
Previous: Peter KreftingNext: Bryan Turner
Message 3 of 7 in “Moving commits from one branch to another (improving my git fu!)”
  1. Mandeep SandhuOct 22, 2013
  2. Peter KreftingOct 22, 2013
  3. Mandeep SandhuOct 22, 2013
  4. Bryan TurnerOct 22, 2013
  5. Mandeep SandhuOct 22, 2013
  6. Noufal IbrahimOct 22, 2013
  7. Mandeep SandhuOct 22, 2013

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.