Changes between Version 76 and Version 77 of WorkingWithGit


Ignore:
Timestamp:
Feb 6, 2017, 9:49:36 PM (7 years ago)
Author:
mkae (Marko Käning)
Comment:

rework "Working with someone else' PR" section according to Rainer's feedback on dev-ML

Legend:

Unmodified
Added
Removed
Modified
  • WorkingWithGit

    v76 v77  
    248248This section describes how to work on a PR without the need to clone or pull from the PR author's repository.
    249249
    250 Check out - according to [https://help.github.com/articles/checking-out-pull-requests-locally/ GitHub's help] - the pull request {{{#ID}}} to work on as a local branch {{{BRANCHNAME}}}:
    251 {{{
    252 git fetch origin pull/ID/head:BRANCHNAME
     250Check out - according to [https://help.github.com/articles/checking-out-pull-requests-locally/ GitHub's help] - the pull request {{{#ID}}} to work on as a local branch:{{{BRANCHNAME}}}:
     251{{{
     252git fetch upstream pull/ID/head:BRANCHNAME
    253253git checkout BRANCHNAME
    254254}}}
    255 then work an it as needed, commit and finally decide where to push the changes made, e.g. by
    256 {{{
    257 git fetch upstream master
    258 git checkout master
    259 git merge BRANCHNAME
     255alternatively you may use
     256{{{
     257curl -sLS https://github.com/macports/macports-ports/pull/<ID>.patch \
     258 | git am
     259}}}
     260then pull in changes from upstream, work on it (if required), commit and push to e.g. {{{upstream}}} (i.e. in case the work is ready for production):
     261{{{
     262# --rebase option only needed if branch.autosetuprebase not set accordingly
     263git pull --rebase upstream master
     264
     265# in case multiple commits have to be edited use
     266git rebase -i
     267
     268# if missing append "Closes: #ID" to last commit message so that GitHub's PR gets auto-closed
     269git commit --amend
     270
    260271git push upstream master
    261272}}}
    262 
    263273
    264274