Changes between Version 22 and Version 23 of CollaborateOnGithub


Ignore:
Timestamp:
Oct 6, 2009, 5:57:15 AM (15 years ago)
Author:
mrts
Comment:

Describe the branchy workflow. Please correct any errors or omissions.

Legend:

Unmodified
Added
Removed
Modified
  • CollaborateOnGithub

    v22 v23  
    5656Go to https://github.com/signup/free and follow the instructions.
    5757
     58== Branchy development: working on several tasks in parallel ==
     59
     60You want to work on several fixes and features (tasks) and want to
     61
     62 * keep the changes for a particular task selt-contained in a branch,
     63 * frequently update the codebase with upstream changes,
     64 * have a has-it-all branch for testing out how the different task branches interact.
     65
     66=== Initial setup ===
     67
     68 1. Create a fork of the automatically updated Django SVN trunk mirror on !GitHub by clicking ''fork'' at http://github.com/django/django/tree/master
     69 1. Clone the fork to your workstation:
     70 {{{
     71git clone git@github.com:YOUR_NICK_HERE/django.git
     72 }}}
     73 1. Add the upstream Django SVN mirror for tracking:
     74 {{{
     75cd django
     76git remote add upstream git://github.com/django/django.git
     77git fetch upstream
     78 }}}
     79
     80=== Working on a task ===
     81
     82'''Goal''': keep the changes self-contained, create and update patches suitable for attaching to [http://code.djangoproject.com/simpleticket tickets in Django trac].
     83
     84 1. Create a branch from master
     85 {{{
     86git checkout -b ticket1234 master
     87 }}}
     88 1. Change files, commit often
     89{{{
     90git commit -am "Changed foo."
     91}}}
     92 1. [wiki:RunningDjangoTests Run tests]
     93 1. Create the remote branch and push changes into it
     94 {{{
     95git push origin ticket1234
     96 }}}
     97 1. Create a patch, attach it to [http://code.djangoproject.com/simpleticket a relevant ticket in trac]
     98 {{{
     99git diff master > ticket1234.patch
     100 }}}
     101
     102Repeat for every ticket you want to work on.
     103
     104=== After upstream has changed ===
     105
     106'''Goal''': bring in the changes in upstream to a task.
     107
     108 1. When the upstream Django SVN mirror is updated, pull the updates from it (fetching and merging in one step)
     109 {{{
     110git pull upstream master
     111 }}}
     112 1. Switch to the ticket branch
     113 {{{
     114git checkout ticket1234
     115 }}}
     116 1. Merge, fix any conflicts
     117 {{{
     118git merge master
     119 }}}
     120 1. [wiki:RunningDjangoTests Run tests]
     121 1. Push changes to GitHub (the remote branch was already created before)
     122 {{{
     123git push
     124 }}}
     125 1. If the patch needs updating, create a new patch and attach it to the relevant ticket
     126 {{{
     127git diff master > ticket1234.patch
     128 }}}
     129
     130Repeat for every ticket you have worked on.
     131
     132=== Testing everything in the has-it-all branch ===
     133
     134'''Goal''': a place to try out the code from several tasks together. `master` can not be used for this as it is used for tracking upstream. This is a temporary branch that can be removed after testing is done.
     135
     136 1. Create the branch
     137 {{{
     138git checkout -b has-it-all master
     139 }}}
     140 1. Merge in all task branches, fix any conflicts that occur in the task branches (i.e. they should merge cleanly)
     141 {{{
     142git merge ticket1234
     143git merge ticket1235
     144...
     145 }}}
     146 1. [wiki:RunningDjangoTests Run tests]
     147 1. Delete the branch
     148 {{{
     149git checkout master
     150git branch -d has-it-all
     151 }}}
     152
    58153== Collaboration on a large feature ==
    59154
     
    63158 * ''Contributors'' are developers who contribute -- under lieutenant's guidance -- to the development of the feature.
    64159
     160''The workflow described below should usually use a separate branch to the keep work isolated, so the instructions need updating.''
     161
    65162=== Lieutenant ===
    66163
     
    118215Largely, this is a copy-paste of the lieutenant workflow, only the tracked repositories and the final step (pull request) differ.
    119216
    120  1. Create a fork of the lieutenant's repository on !GitHub by clicking ''fork'' at e.g. `http://github.com/LIEUTENANT_NICK_HERE/django/tree/master` (the URL may differ, obviously, LIEUTENANT_NICK_HERE is just a placeholder).
     217 1. Create a fork of the lieutenant's repository on !GitHub by clicking ''fork'' at e.g. `http://github.com/LIEUTENANT_NICK_HERE/django/tree/master`.
    121218 1. Pick a task from the lieutenant's !GitHub project wiki, update the wiki as needed.
    122219 1. Clone the fork to your workstation:
     
    169266 1. Push changes to the public code hosting service
    170267 1. Update docs if needed
    171 
    172 == Working on single tickets ==
Back to Top