Changes between Version 1 and Version 2 of WorkingWithGitPRDraft


Ignore:
Timestamp:
Nov 4, 2016, 5:42:08 PM (7 years ago)
Author:
mojca (Mojca Miklavec)
Comment:

preliminary notes about pull requests

Legend:

Unmodified
Added
Removed
Modified
  • WorkingWithGitPRDraft

    v1 v2  
    169169
    170170
    171 
     171== Pull requests for ports ==
     172
     173=== Non-committers: How to submit a pull request? ===
     174
     175'''Note:'''
     176  * There is no need to submit a pull request to GitHub if you are more comfortable uploading patches to the existing bug tracker on Trac.
     177  * There is no need to submit pull requests for existing Trac tickets to GitHub. If you feel someone should do something about your tickets, please send a reminder to the developer mailing list.
     178
     179'''Important:''' Please make sure to [https://help.github.com/articles/allowing-changes-to-a-pull-request-branch-created-from-a-fork/ Allow edits from maintainers] when you create the pull request.
     180{{{
     181#!div style="font-size: 80%"
     182''The committer will usually have to rebase your changes on top of master to keep the history linear. Unless those changes are pushed to the branch with your pull request first, your request will appear to be rejected rather than merged on the GitHub user interface.''
     183}}}
     184
     185==== 1. Fork the repository ====
     186
     187If you want to submit a patch, you will have to fork the repository first.
     188
     189Go to https://github.com/macports/macports-ports/ and click the fork button at the top right.
     190
     191Clone the repository with:
     192{{{
     193git clone git@github.com:<your-username>/macports-ports.git # or
     194git clone https://github.com/<your-username>/macports-ports.git # if SSH does not work on your network
     195}}}
     196navigate to it (`cd macports-ports`) and add a link to upstream:
     197{{{
     198git remote add upstream git@github.com:macports/macports-ports.git # use https as above if needed
     199}}}
     200The name `upstream` is a name you can pick arbitrary. You can check which "remote" repositories you have with
     201{{{
     202> git remote -v
     203origin    https://github.com/<your-username>/macports-www.git (fetch)
     204origin    https://github.com/<your-username>/macports-www.git (push)
     205upstream  https://github.com/macports/macports-www.git (fetch)
     206upstream  https://github.com/macports/macports-www.git (push)
     207}}}
     208
     209TODO: link to some short git docs about working with remotes
     210
     211==== 1. Make changes ====
     212
     213
     214See the [#commit section on committing changes] to find out how to get your changes into the repository.
     215
     216=== Committers: How to merge a pull request? ===
     217
     218==== TODO ====
     219
     220{{{
     221USER=some-username
     222REMOTEBR=remote-branch-name
     223LOCALBR=local-branch-name
     224}}}
     225
     226{{{
     227git fetch https://github.com/$USER/macports-ports.git $REMOTEBR
     228git checkout -b $LOCALBR FETCH_HEAD
     229git rebase master
     230}}}
     231
     232`FETCH_HEAD` is the head of the last branch you fetched (and won't change until you run another `fetch`).
     233One may create local branches from it.
     234It can also be very useful when fetching directly from URL without having to create temporary remotes.
     235
     236
     237==== Modifying pull requests ====
     238
     239If the user allowed modifying the branch of PR, you can use the following command to force push the changes to PR before accepting them:
     240{{{
     241git push -f https://github.com/$USER/macports-ports.git $REMOTEBR
     242}}}
     243
     244==== Committing or accepting changes ====
     245
     246TODO
    172247
    173248== Common `git` tasks while working with ports ==