Changes between Version 48 and Version 49 of DeveloperGuidelines/Git


Ignore:
Timestamp:
05/18/12 05:25:07 (9 years ago)
Author:
Fran Boon
Comment:

Simpler workflow option without story branch

Legend:

Unmodified
Added
Removed
Modified
  • DeveloperGuidelines/Git

    v48 v49  
    2020https://docs.google.com/drawings/d/1TppJKr9Qrq6I2KpkljRixx5gYh1seRqCXk8KDWdeIF0/edit
    2121=== Ongoing Coding ===
    22 We suggest adopting the [http://blog.hasmanythrough.com/2008/12/18/agile-git-and-the-story-branch-pattern Story Branch] pattern, which allows squashing commits in order to keep the main Trunk as clean as possible
    23 {{{
    24 cd <mydirectory>
    25 
    26 # Set github.com/flavour/eden as the upstream repository
    27 git remote add upstream git://github.com/flavour/eden.git
     22{{{
     23cd web2py/applications/eden
    2824
    2925# Update your working directory with latest code from Trunk
    30 git fetch upstream
    31 git merge upstream/master
    32 git checkout -b <mystory>
     26git pull upstream
    3327
    3428# Write Code
     29
     30# Quick review of code (no test code left in, etc)
     31git diff
     32
     33# Check for any new files which need adding
     34git status
     35git add.
     36
     37# Commit Code (Note, no pushes to GitHub here)
    3538git commit -am "My Story: Part 1"
    3639.
     
    3942git commit -am "My Story: Part N"
    4043
     44# Merge latest Trunk
     45git pull upstream
     46
     47# Resolve any conflicts (see below for how)
     48
     49# Commit fixed code
     50git add .
     51git commit -a
     52
     53# Squash commits to as few as possible to keep revision history clean & make it easier to review the work
     54git rebase -i
     55
     56# Push to your branch on GitHub
     57git push
     58}}}
     59
     60[[Image(https://docs.google.com/drawings/pub?id=1Vhvm1EmqWOVNZkZsiJ0MLLpdTl6H_ya263Tdb2HK1N0&w=960&h=720)]]
     61https://docs.google.com/drawings/d/1Vhvm1EmqWOVNZkZsiJ0MLLpdTl6H_ya263Tdb2HK1N0/edit
     62
     63Once you have pushed to your branch on GitHub, you will likely want this to be merged with Trunk - this should be done via a Pull Request. This is done on GitHub:
     64* https://github.com/mygitusername/eden/pull/new/<mystory>(the branch name)
     65
     66[[Image(https://docs.google.com/drawings/pub?id=1QmGeuQvFpg3pDQpM9xu81V7MlVy4uU8EzVIRqQ14MwU&w=792&h=353)]]
     67https://docs.google.com/drawings/d/1QmGeuQvFpg3pDQpM9xu81V7MlVy4uU8EzVIRqQ14MwU/edit
     68
     69If you want to adopt the [http://blog.hasmanythrough.com/2008/12/18/agile-git-and-the-story-branch-pattern Story Branch] pattern, which allows pushing interim work to GitHub for review & also allowing contributing quick fixes to Trunk without needing to complete the interim work:
     70{{{
     71git checkout -b <mystory>
     72
     73git commit -a
     74...
     75git commit -a
     76
    4177# Quick review of code (no test code left in, etc)
    4278git diff master...HEAD
    43 
    44 # Merge latest Trunk
    45 git fetch upstream
    46 git merge upstream/master
    47 
    48 # Squash commits to as few as possible to keep revision history clean & make it easier to review the work
    49 git rebase -i
    50 
    51 # One more method to squash your commits if they are not in between two executions of git pull or git merge is:
     79}}}
     80
     81One more method to squash your commits if they are not in between two executions of git pull or git merge is:
     82{{{
    5283git stash
    5384git reset HEAD@{N}
    5485git commit -am 'Your commit message for the one-big-commit'
    55 git push upstream HEAD(or your-branch/tag-name)
     86git push
    5687git stash pop
    57 
    58 }}}
    59 
    60 [[Image(https://docs.google.com/drawings/pub?id=1Vhvm1EmqWOVNZkZsiJ0MLLpdTl6H_ya263Tdb2HK1N0&w=960&h=720)]]
    61 https://docs.google.com/drawings/d/1Vhvm1EmqWOVNZkZsiJ0MLLpdTl6H_ya263Tdb2HK1N0/edit
    62 
    63 Once you have pushed to your branch on GitHub, you will likely want this to be merged with Trunk - this should be done via a Pull Request. This is done on GitHub:
    64 * https://github.com/mygitusername/eden/pull/new/<mystory>(the branch name)
    65 
    66 [[Image(https://docs.google.com/drawings/pub?id=1QmGeuQvFpg3pDQpM9xu81V7MlVy4uU8EzVIRqQ14MwU&w=792&h=353)]]
    67 https://docs.google.com/drawings/d/1QmGeuQvFpg3pDQpM9xu81V7MlVy4uU8EzVIRqQ14MwU/edit
    68 
     88}}}
    6989==== Resolving Merge Conflicts ====
    7090If you encounter conflicts during the rebase, the conflicts will be tagged in the files with: