{"thread":{"id":"24027","subject":"Moving a branch to a different node","startedAt":"2010-06-06T21:01:31Z","lastAt":"2010-06-06T22:19:40Z","messageCount":3,"participants":["Mike Solomon","Taylor Hedberg","Andreas Schwab"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"143112","messageId":"C831D94B.1D9DF%mikesol@ufl.edu","threadId":"24027","inReplyTo":null,"subject":"Moving a branch to a different node","fromName":"Mike Solomon","fromEmail":"mikesol@ufl.edu","sentAt":"2010-06-06T21:01:31Z","receivedAt":"2010-06-06T21:01:31Z","isPatch":false,"sender":{"key":"mikesol@ufl.edu","avatar":null},"body":"Hey git users,\n    I am working on a project where I proceeded by the following steps:\n\nstarting from master...\n1) create branch foo\n2) work in foo, make some commits, then a patch named Foo\n3) create a branch bar while in foo\n4) work in bar, make some commits, then a patch named Bar\n\ngit show-branch gives me\n\n! [master] Hello\n * [foo] Foo\n  ! [bar] Bar\n\nI would like to make bar split off of master instead of foo so that I can\nformat a patch that can be applied to master (Bar) without having to first\napply Foo.  Is there a way to do that?\n\nThank you!\n~Mike\n"},{"id":"143115","messageId":"AANLkTimoPjrDNlGqu8VHGqADiH8zCIMSpMaUr7Et9MvS@mail.gmail.com","threadId":"24027","inReplyTo":"C831D94B.1D9DF%mikesol@ufl.edu","subject":"Re: Moving a branch to a different node","fromName":"Taylor Hedberg","fromEmail":"tmhedberg@gmail.com","sentAt":"2010-06-06T22:08:58Z","receivedAt":"2010-06-06T22:08:58Z","isPatch":false,"sender":{"key":"tmhedberg@gmail.com","avatar":"https://gravatar.com/avatar/d046da5ea94a7957169aef0fe122771a1f8d9387d39bc68fcfb1332978e11a6c?d=mp&s=160"},"body":"I believe what you want is:\n\ngit rebase --onto master foo bar\n\nOn Sun, Jun 6, 2010 at 5:01 PM, Mike Solomon <mikesol@ufl.edu> wrote:\n>\n> Hey git users,\n>    I am working on a project where I proceeded by the following steps:\n>\n> starting from master...\n> 1) create branch foo\n> 2) work in foo, make some commits, then a patch named Foo\n> 3) create a branch bar while in foo\n> 4) work in bar, make some commits, then a patch named Bar\n>\n> git show-branch gives me\n>\n> ! [master] Hello\n>  * [foo] Foo\n>  ! [bar] Bar\n>\n> I would like to make bar split off of master instead of foo so that I can\n> format a patch that can be applied to master (Bar) without having to first\n> apply Foo.  Is there a way to do that?\n>\n> Thank you!\n> ~Mike\n>\n>\n> --\n> To unsubscribe from this list: send the line \"unsubscribe git\" in\n> the body of a message to majordomo@vger.kernel.org\n> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n"},{"id":"143120","messageId":"m2hblfregz.fsf@igel.home","threadId":"24027","inReplyTo":"C831D94B.1D9DF%mikesol@ufl.edu","subject":"Re: Moving a branch to a different node","fromName":"Andreas Schwab","fromEmail":"schwab@linux-m68k.org","sentAt":"2010-06-06T22:19:40Z","receivedAt":"2010-06-06T22:19:40Z","isPatch":false,"sender":{"key":"schwab@linux-m68k.org","avatar":"https://avatars.githubusercontent.com/u/2175493?v=4"},"body":"Mike Solomon <mikesol@UFL.EDU> writes:\n\n> Hey git users,\n>     I am working on a project where I proceeded by the following steps:\n>\n> starting from master...\n> 1) create branch foo\n> 2) work in foo, make some commits, then a patch named Foo\n> 3) create a branch bar while in foo\n> 4) work in bar, make some commits, then a patch named Bar\n>\n> git show-branch gives me\n>\n> ! [master] Hello\n>  * [foo] Foo\n>   ! [bar] Bar\n>\n> I would like to make bar split off of master instead of foo so that I can\n> format a patch that can be applied to master (Bar) without having to first\n> apply Foo.  Is there a way to do that?\n\nIIUC you want to rebase the commits in bar that are not in foo onto\nmaster.\n\n$ git rebase --onto master foo bar\n\nAndreas.\n\n-- \nAndreas Schwab, schwab@linux-m68k.org\nGPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5\n\"And now for something completely different.\"\n"}]}