| 1 | = Working With Github = |
| 2 | |
| 3 | We rely heavily on Github for our workflow, because it makes code review easier and provides an easily viewable history of changes, pull requests, etc. |
| 4 | |
| 5 | *NOTE*: As of this writing (July 2015), we only use "regular" Github (github.com). The project does *not* make use of MIT's `github.mit.edu` service, with the single exception of adding a remote for the moira repository to fetch changes from. (described elsewhere) |
| 6 | |
| 7 | If you don't have a Github account, go create one now. The rest of this document assumes that you have a Github account, and can authenticate to it from your Git client, whether using SSH keys, passwords over SSL/webdav, or some other means. |
| 8 | |
| 9 | == Forking Projects == |
| 10 | |
| 11 | In preparation for working on a project, you should log in to Github's web interface, find the project under `https://github.com/mit-athena`/whatever, and fork it into your Github account. |
| 12 | |
| 13 | In your [wiki:WorkingWithTheRepository checkout of the Athena source tree], change to the project's directory, and add your fork as a remote. A common convention is to use your username as the remote name. This example assumes your username is `jdreed` and your Github username is also `jdreed`: |
| 14 | |
| 15 | {{{ |
| 16 | jdreed@infinite-loop:~/src/athena-source-tree/athena/getcluster$ git remote add jdreed https://github.com/jdreed/getcluster |
| 17 | }}} |
| 18 | |
| 19 | (If you're using SSH keys to authenticate to Github, you would do use `git@github.com:jdreed/getcluster.git` as the URL instead.) |
| 20 | |
| 21 | == Pushing and Pull Requests == |
| 22 | |
| 23 | When you [wiki:CommittingYourChanges commit your changes], you should push them to *your* fork. |
| 24 | |
| 25 | {{{ |
| 26 | jdreed@infinite-loop:~/src/athena-source-tree/athena/getcluster$ git commit -a -m 'Fix awesome bugs' |
| 27 | jdreed@infinite-loop:~/src/athena-source-tree/athena/getcluster$ git push jdreed master |
| 28 | }}} |
| 29 | |
| 30 | Then, visit you fork on Github's website, and submit a Pull Request from your branch. If your pull request contains multiple commits, write a summary of it in the field provided. If it only contains a single commit, it will be pre-populated from the commit message. |
| 31 | |
| 32 | That will take you to a URL like this: `https://github.com/mit-athena/getcluster/pull/1` (*SEE IMPORTANT WARNING BELOW *) |
| 33 | |
| 34 | You can comment on others' pull requests, and they will comment on yours. When the pull request receives one more "+1"s, you can return to your checkout of the source tree, and push your changes to `origin`, as described in [wiki:CommittingYourChanges this page]. |
| 35 | |
| 36 | === WARNING === |
| 37 | |
| 38 | *WARNING*: NEVER, EVER, EVER, EVER click the big green "Merge" button on a Pull Request page on Github. That will cause our synchronization scripts to break. |
| 39 | |