[MacPorts] WorkingWithGit modified

MacPorts noreply at macports.org
Mon Feb 6 21:49:36 UTC 2017


Page "WorkingWithGit" was changed by mkae
Diff URL: <https://trac.macports.org/wiki/WorkingWithGit?action=diff&version=77>
Revision 77
Comment: rework "Working with someone else' PR" section according to Rainer's feedback on dev-ML
Changes:
-------8<------8<------8<------8<------8<------8<------8<------8<--------
Index: WorkingWithGit
=========================================================================
--- WorkingWithGit (version: 76)
+++ WorkingWithGit (version: 77)
@@ -247,19 +247,29 @@
 
 This section describes how to work on a PR without the need to clone or pull from the PR author's repository. 
 
-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}}}:
-{{{
-git fetch origin pull/ID/head:BRANCHNAME
+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}}}:
+{{{
+git fetch upstream pull/ID/head:BRANCHNAME
 git checkout BRANCHNAME
 }}}
-then work an it as needed, commit and finally decide where to push the changes made, e.g. by
-{{{
-git fetch upstream master
-git checkout master
-git merge BRANCHNAME
+alternatively you may use
+{{{
+curl -sLS https://github.com/macports/macports-ports/pull/<ID>.patch \
+ | git am
+}}}
+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):
+{{{
+# --rebase option only needed if branch.autosetuprebase not set accordingly
+git pull --rebase upstream master
+
+# in case multiple commits have to be edited use
+git rebase -i
+
+# if missing append "Closes: #ID" to last commit message so that GitHub's PR gets auto-closed
+git commit --amend
+
 git push upstream master
 }}}
-
 
 
 == Common `git` tasks while working with MacPorts base ==
-------8<------8<------8<------8<------8<------8<------8<------8<--------

--
Page URL: <https://trac.macports.org/wiki/WorkingWithGit>
MacPorts <https://www.macports.org/>
Ports system for macOS

This is an automated message. Someone added your email address to be
notified of changes on 'WorkingWithGit' page.
If it was not you, please report to admin at macports.org.


More information about the macports-changes mailing list