Skip to content

balancedtech/howigitdown

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

Feature Development

Basic Steps

  1. Git Fetch to update your staging repository
  2. Pull to update your local Release Branch
  3. Check out a feature branch
  4. Do work in your feature branch, committing early and often
  5. Rebase frequently to incorporate upstream changes
  6. Interactive rebase (squash) your commits
  7. Notify QA of your completed feature
  8. Once your feature has been approved by QA
    1. Rebase once again from the Release Branch
    2. Merge your changes into the Release Branch
    3. Push your changes upstream
    4. Delete your remote branch

Branch naming conventions

“#{developer_initials}_#{trello_card_number_only_numbers}_#{trello_card_brief_description.gsub(/\s/,‘_’)}”.downcase

e.g.:
developer name: Rodney J. Woodruff
trello card number: 48
card’s desc: Add a new Store Interface

==> rjw_48_fix_add_a_new_store_interface

Should match: /^[a-z]{2,3}_\d{1,5}(_[0-9a-z]+)+$/

;-)

Steps in Depth

Background Info

The Release Branch is rb_2012_04_03
Your Name is Super Developer
Your initials are sd
Your trello card number is 35

Before you begin you must use this command

git config branch.autosetuprebase always
git config branch.master.rebase true

The code above will make your git pull command default to always add – -rebase

  1. Pull to update your local Release Branch

    git checkout --track origin/rb_2012_04_03
    git pull origin rb_2012_04_03

    this will create a local branch named rb_2012_04_03

  2. Check out a feature branch

    git checkout -b sd_35_country_validations

    your initials + trello card number + small description (all lowercase)

  3. 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 bar.rb
    git commit -m "COMPLETED: tests and all"

  4. Rebase frequently to incorporate upstream changes

    git fetch
    git rebase origin/rb_2012_04_03

  5. Interactive rebase (squash) your commits

    git rebase -i rb_2012_04_03

    Git will display an editor window with a list of the commits to be modified, something like:

    pick 3dcd585 Adding Comment blah
    pick 9f5c362 Adding Comment something important
    pick dcd4813 Adding Comment video on product page
    pick 977a754 Adding Comment update cart
    pick 9ea48e3 Adding Comment bubbles make me smile

    Now we tell git what we to do. Change these lines to:

    pick 3dcd585 Adding Comment blah
    squash 9f5c362 Adding Comment something important
    squash dcd4813 Adding Comment video on product page
    squash 977a754 Adding Comment update cart
    squash 9ea48e3 Adding Comment bubbles make me smile

  6. Notify QA of your completed feature (still works if you are QA)

    You can do this by following the steps below:
    1. move your card from the ‘In Progress’ list to the ‘Test’ list
    2. add the qa person to the card
    3. add a comment to the card’s activity stream which will notify the appropriate qa person that was added in step 2
  7. Once your feature has been approved by QA

    1. Rebase once again from the Release Branch

      git fetch
      git rebase origin/rb_2012_04_03

    2. Merge your changes into the Release Branch

      git checkout rb_2012_04_03
      git merge sd_35_country_validations

    3. Push your changes upstream

      git push origin rb_2012_04_03

    4. After your feature has been merged into master, delete your remote branch

      git push origin :sd_35_country_validations

Feature Development with multiple developers

push your local branch to github

git push origin branch_name
git branch --set-upstream branch_name origin/branch_name

Then, others can check out your changes with a git fetch and a git checkout.

git fetch
git checkout --track origin/branch_name

Use the same exact steps as above treating the shared branch as the release branch. You cannot rebase commits that have been pushed remotely, unless all the people who have downloaded the branch agree to delete the branch and re-download.

BugFixes for production not associated to a release

The only difference from the steps above is

  • Use the master branch instead of the release branch
  • ONLY have ONE commit(squashed)
  • do NOT have a partial fix

Further Reading

A Git Workflow for Agile Teams
A successful Git branching model
The Case for Git Rebase
The ProGit Book
Trello

About

A repository to describe my git workflow

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published