Created
April 21, 2020 21:09
-
-
Save jonesmac/80bb45656cbcf9b02f15fa9e3e295fc9 to your computer and use it in GitHub Desktop.
Revisions
-
jonesmac revised this gist
Apr 21, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -28,7 +28,7 @@ Assuming you have feature/124 checked out, you can use `git rebase --onto develo What's actually taking place when you run the command: 1. set `develop` (currently at N) (arg 1) as the *new base branch* for your current branch - `feature/124` * `--onto` is saying reset `feature/124` `on to` `develop`'s tip 2. set `feature/123` (currently at I) (arg 2) as the starting point for the new commits * All changes made by commits in `feature/124` but that are not in `feature/123` (J, L, and M) are saved to a temporary area. 3. replay the commits in the temporary area to branch `feature/124` -
jonesmac created this gist
Apr 21, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,34 @@ Given I have a setup like so ``` A---B---C---D develop \ E---F---G---H---I feature/123 \ J---L---M feature/124 ``` And feature/123 is squash merged (N) into develop leaving feature/124 with extra commits ``` A---B---C---D---N develop \ E---F---G---H---I feature/123 \ J---L---M feature/124 ``` Assuming you have feature/124 checked out, you can use `git rebase --onto develop feature/123` to end up with ``` A---B---C---D---N develop \ J---L---M feature/124 ``` What's actually taking place when you run the command: 1. set `develop` (currently at N) (arg 1) as the *new base branch* for your current branch - `feature/124` * --onto is saying reset `feature/124` `on to` `develop`'s tip 2. set `feature/123` (currently at I) (arg 2) as the starting point for the new commits * All changes made by commits in `feature/124` but that are not in `feature/123` (J, L, and M) are saved to a temporary area. 3. replay the commits in the temporary area to branch `feature/124`