Forked from ozh/git cherry-pick within a pull request.md
Created
October 8, 2022 15:29
-
-
Save willi-dev/c56f4ca24224dbeed03350b36bbfa650 to your computer and use it in GitHub Desktop.
Revisions
-
ozh renamed this gist
Jul 14, 2022 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
ozh revised this gist
May 2, 2021 . No changes.There are no files selected for viewing
-
ozh revised this gist
Apr 11, 2015 . 1 changed file with 6 additions and 5 deletions.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 @@ -1,24 +1,25 @@ ## 1. Create new branch: ```sh git checkout -b otherrepo-master master ``` ## 2. Get the contents of the PR ```sh git pull https://github.com/otherrepo/my-repo-name.git master ``` ## 3. Change back to master ```sh git checkout master ``` ## 4. Now DO NOT merge the whole branch, BUT cherry-pick exactly the commits from the other branch. The hash uniquely defines the commit - regardless of the branch it is in. ```sh git cherry-pick abc0123 ``` ## 5. Check, remove the temp branch, push ```sh git log git branch -D otherrepo-master -
ozh revised this gist
Apr 11, 2015 . 1 changed file with 2 additions and 2 deletions.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 @@ -1,9 +1,9 @@ 1. Create new branch: ```sh git checkout -b otherrepo-master master ``` 2. Get the contents of the PR ```sh git pull https://github.com/otherrepo/my-repo-name.git master ``` -
ozh created this gist
Apr 11, 2015 .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,26 @@ 1. Create new branch: ```sh git checkout -b otherrepo-master master ``` 2. Get the contents of the PR ```sh git pull https://github.com/otherrepo/my-repo-name.git master ``` 3. Change back to master ```sh git checkout master ``` 4. Now DO NOT merge the whole branch, BUT cherry-pick exactly the commits from the other branch. The hash uniquely defines the commit - regardless of the branch it is in. ```sh git cherry-pick abc0123 ``` 5. Check, remove the temp branch, push ```sh git log git branch -D otherrepo-master git push origin master ```