Skip to content

Instantly share code, notes, and snippets.

@lorgio
Created November 4, 2010 15:28
Show Gist options
  • Select an option

  • Save lorgio/662621 to your computer and use it in GitHub Desktop.

Select an option

Save lorgio/662621 to your computer and use it in GitHub Desktop.
h2. Feature Development
h3. Basic Steps
<ol>
<li>Pull to update your local Release Branch</li>
<li>Check out a feature branch</li>
<li>Do work in your feature branch, committing early and often</li>
<li>Rebase frequently to incorporate upstream changes</li>
<li>Interactive rebase (squash) your commits</li>
<li>Notify QA of your completed feature</li>
<li>Once your feature has been approved by QA</li>
<ol>
<li>Rebase once again from the Release Branch</li>
<li>Merge your changes into the Release Branch</li>
<li>Push your changes upstream</li>
</ol>
</ol>
h3. Steps in Depth
h4. Background Info
The Release Branch is *RB_10_29_2010*
_My Name is Lorgio Jimenez_
_My initial are *lj*_
_my agile buddy feature is *O1477*_
h4. Before you begin you must use this command
bq. git config branch.autosetuprebase always
The code above will make your git pull command default to always add --rebase
<ol>
<li>
h4. +Pull to update your local Release Branch+
@git checkout --track origin/RB_10_29_2010@
@git pull origin RB_10_29_2010@
<p>this will create a local branch named RB_10_29_2010</p>
</li>
<li>
h4. +Check out a feature branch+
@git checkout -b lj_O1477_nav_menus@
<p>_*My Initials + agile buddy ticket + small description*_</p>
</li>
<li>
h4. +Do work in your feature branch, committing early and often+
@#do your work@
@git add foo.rb@
@git commit -m "WIP: hacking on this and that"@
@#do more work@
@git add -p bar.rb@
</li>
<li>
h4. +Rebase frequently to incorporate upstream changes+
@git fetch origin RB_10_29_2010@
@git rebase origin/RB_10_29_2010@
</li>
<li>
h4. +Interactive rebase (squash) your commits+
@git rebase -i origin/RB_10_29_2010@
<h5>
*Git will display an editor window with a list of the commits to be modified, something like:*
@pick 3dcd585 Adding Comment model, migrations, spec @
@pick 9f5c362 Adding Comment controller, helper, spec@
@pick dcd4813 Adding Comment relationship with Post@
@pick 977a754 Comment belongs to a User@
@pick 9ea48e3 Comment form on Post show page@
*Now we tell git what we to do. Change these lines to:*
@pick 3dcd585 Adding Comment model, migrations, spec@
@squash 9f5c362 Adding Comment controller, helper, spec@
@squash dcd4813 Adding Comment relationship with Post@
@squash 977a754 Comment belongs to a User@
@squash 9ea48e3 Comment form on Post show page@
</h5>
</li>
<li>
h4. +Notify QA of your completed feature+
h5. you can do this by updating your agile buddy ticket and adding a comment that the feature has been completed. Add ALL the QA members, Laura Manni & Rodney Woodruff to the message
</li>
<li>
h4. +Once your feature has been approved by QA+
</li>
<ol>
<li>
h4. +Rebase once again from the Release Branch+
@git fetch origin RB_10_29_2010@
@git rebase origin/RB_10_29_2010@
</li>
<li>
h4. +Merge your changes into the Release Branch+
@git checkout RB_10_29_2010@
@git merge lj_O1477_nav_menus@
</li>
<li>
h4. +Push your changes upstream+
@git push origin RB_10_29_2010@
</li>
</ol>
</ol>
h2. Feature Development with multiple users
h4. push your local branch to github
@git push origin branch_name@
@git branch --set-upstream branch_name origin/branch_name@
h5. Then, others can check out your changes with a git fetch and a git checkout.
@git fetch@
@git checkout --track origin/branch_name@
h5. Use the same exact steps as above and ONLY you should NEVER rebase a commit that has already been pushed remotely.
h2. BugFixes
h4. The only difference from the steps above is
<ul>
<li>Use the master branch instead of the release branch</li>
<li>ONLY have ONE commit(squashed)</li>
<li>do NOT have a partial fix</li>
</ul>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment