Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save willi-dev/c56f4ca24224dbeed03350b36bbfa650 to your computer and use it in GitHub Desktop.
Save willi-dev/c56f4ca24224dbeed03350b36bbfa650 to your computer and use it in GitHub Desktop.

Revisions

  1. @ozh ozh renamed this gist Jul 14, 2022. 1 changed file with 0 additions and 0 deletions.
  2. @ozh ozh revised this gist May 2, 2021. No changes.
  3. @ozh ozh revised this gist Apr 11, 2015. 1 changed file with 6 additions and 5 deletions.
    11 changes: 6 additions & 5 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -1,24 +1,25 @@
    1. Create new branch:
    ## 1. Create new branch:
    ```sh
    git checkout -b otherrepo-master master
    ```

    2. Get the contents of the PR
    ## 2. Get the contents of the PR
    ```sh
    git pull https://github.com/otherrepo/my-repo-name.git master
    ```

    3. Change back to 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.
    ## 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
    ## 5. Check, remove the temp branch, push
    ```sh
    git log
    git branch -D otherrepo-master
  4. @ozh ozh revised this gist Apr 11, 2015. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -1,9 +1,9 @@
    1. Create new branch:
    1. Create new branch:
    ```sh
    git checkout -b otherrepo-master master
    ```

    2. Get the contents of the PR
    2. Get the contents of the PR
    ```sh
    git pull https://github.com/otherrepo/my-repo-name.git master
    ```
  5. @ozh ozh created this gist Apr 11, 2015.
    26 changes: 26 additions & 0 deletions gistfile1.md
    Original 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
    ```