Skip to content

Instantly share code, notes, and snippets.

@pepasflo
Last active May 8, 2019 20:23
Show Gist options
  • Select an option

  • Save pepasflo/b1c849002951a644588c019f45a0be01 to your computer and use it in GitHub Desktop.

Select an option

Save pepasflo/b1c849002951a644588c019f45a0be01 to your computer and use it in GitHub Desktop.

Revisions

  1. pepasflo revised this gist May 8, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -30,7 +30,7 @@ Now, while waiting for that PR to be approved, if you need to continue making mo
    - `git push origin`
    - go to github.com and make a PR

    The key difference is that on github.com you'll change the "base" from `develop` to `OTT-217-cake` when creating the PR.
    The key difference is that on github.com you'll change the "base" from `develop` to `OTT-217-cake` when creating the second PR.


    ## Merging the first PR
  2. pepasflo revised this gist May 8, 2019. 1 changed file with 4 additions and 4 deletions.
    8 changes: 4 additions & 4 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -13,8 +13,8 @@ Create your first PR as per normal:
    - `git checkout -b OTT-217-cake`
    - edit some files
    - `git add .`
    - `git commit -m "OTT-217 Add some cake to the fridge"
    - `git push origin
    - `git commit -m "OTT-217 Add some cake to the fridge"`
    - `git push origin`
    - go to github.com and make a PR


    @@ -26,8 +26,8 @@ Now, while waiting for that PR to be approved, if you need to continue making mo
    - `git checkout -b OTT-218-more-cake`
    - edit some files
    - `git add .`
    - `git commit -m "OTT-218 Add another cake to the fridge"
    - `git push origin
    - `git commit -m "OTT-218 Add another cake to the fridge"`
    - `git push origin`
    - go to github.com and make a PR

    The key difference is that on github.com you'll change the "base" from `develop` to `OTT-217-cake` when creating the PR.
  3. pepasflo created this gist May 8, 2019.
    51 changes: 51 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,51 @@
    # Stacked-PR workflow

    Some notes about how I work with stacked branches (a.k.a. dependent PR's).

    Kindof a pain but it works. This could probably be automated with some clever scripting against github's API.


    ## Creating the first PR

    Create your first PR as per normal:

    - (assuming you are currently in the `develop` branch)
    - `git checkout -b OTT-217-cake`
    - edit some files
    - `git add .`
    - `git commit -m "OTT-217 Add some cake to the fridge"
    - `git push origin
    - go to github.com and make a PR


    ## Creating the second PR

    Now, while waiting for that PR to be approved, if you need to continue making more changes, proceed as per usual except you'll be branching off of your existing branch, rather than branching off of `develop`.

    - (assuming you are currently in the `OTT-217-cake` branch)
    - `git checkout -b OTT-218-more-cake`
    - edit some files
    - `git add .`
    - `git commit -m "OTT-218 Add another cake to the fridge"
    - `git push origin
    - go to github.com and make a PR

    The key difference is that on github.com you'll change the "base" from `develop` to `OTT-217-cake` when creating the PR.


    ## Merging the first PR

    Click the "squash and merge" button on github.com, then "unstack" your second PR:

    - `git checkout develop`
    - `git pull`
    - `git checkout OTT-218-more-cake`
    - `git rebase develop`
    - `git push --force`

    Then go to the second PR in github.com and change the "base" to `develop`.


    ## Merging the second PR

    Click the "squash and merge" button on github.com.