[MacPorts] WorkingWithGit modified

Rainer Müller raimue at macports.org
Mon Feb 6 21:28:09 UTC 2017


On 2017-02-06 21:28, MacPorts wrote:
> Page "WorkingWithGit" was changed by mkae
> Diff URL: <https://trac.macports.org/wiki/WorkingWithGit?action=diff&version=76>
> Revision 76
> Comment: Describe how to work on someone's PR
> Changes:
> -------8<------8<------8<------8<------8<------8<------8<------8<--------
> Index: WorkingWithGit
> =========================================================================
> --- WorkingWithGit (version: 75)
> +++ WorkingWithGit (version: 76)
> @@ -243,6 +243,22 @@
>  which will put your local changes on top of ours. Pushing to your fork will update the pull request.
>  
>  
> +=== Working with someone else's pull request through its ID ===
> +
> +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
> +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
> +git push upstream master
> +}}}

We do not want to use 'git merge' at this point. This would create an
extra merge commit in the history and we want to avoid that. Please use
'git rebase' instead, but remember that you have to run it on BRANCHNAME.

I still think that 'git am' is the easiest option. The following would
be equivalent to fetch and rebase:

curl -sLS https://github.com/macports/macports-ports/pull/<ID>.patch \
  | git am

Also, always remember to add a "Closes: #<ID>" to the commit message
before pushing. Otherwise GitHub will not recognize what you are doing.
Use 'git commit --amend' to edit the commit message of the latest
commit; use 'git rebase -i' if you need to edit multiple commits.

Rainer


More information about the macports-dev mailing list