Changes between Version 78 and Version 79 of WorkingWithGit
- Timestamp:
- Jun 22, 2017, 1:40:55 PM (7 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
WorkingWithGit
v78 v79 248 248 This section describes how to work on a PR without the need to clone or pull from the PR author's repository. 249 249 250 ==== 1. Check out the pull request locally 251 250 252 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 253 {{{ … … 258 260 | git am 259 261 }}} 260 then 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): 262 or a wrapper script such as hub 263 {{{ 264 hub am https://github.com/macports/macports-ports/pull/<ID> 265 }}} 266 267 Put the proposed changes on top of the current upstream/master: 261 268 {{{ 262 269 # --rebase option only needed if branch.autosetuprebase not set accordingly 263 270 git pull --rebase upstream master 264 271 }}} 272 273 ==== 2. Test changes and modify commits 274 275 Work on the changes if required and commit your modifications. 276 277 {{{ 278 # add changes to the latest commit 279 git add Portfile 280 git commit --amend 265 281 # in case multiple commits have to be edited use 266 282 git rebase -i 267 268 # if missing append "Closes: #ID" to commit messages so that GitHub's PR gets auto-closed 283 }}} 284 285 ==== 3. Publish changes 286 287 ===== a) Update PR with your changes 288 289 For this you have to find the source GitHub repository and branch the PR was created from. You can usually identify this on the GitHub web interface: 290 291 {{{ 292 PR_AUTHOR wants to merge 1 commit into macports:master from PR_AUTHOR:PR_BRANCH 293 }}} 294 295 Use this information to update the PR by pushing your changes, where `$BRANCHNAME` is the name of the branch you are currently working on: 296 297 {{{ 298 git push https://github.com/$PR_AUTHOR/macports-ports $BRANCHNAME:$PR_BRANCH 299 }}} 300 301 ===== b) Close PR and merge changes to upstream/master 302 303 {{{ 304 # append "Closes: #ID" to the commit messages so that GitHub's PR gets auto-closed 269 305 git commit --amend 270 306