- Git Fetch to update your staging repository
- Pull to update your local Release Branch
- Check out a feature branch
- Do work in your feature branch, committing early and often
- Rebase frequently to incorporate upstream changes
- Interactive rebase (squash) your commits
- Notify QA of your completed feature
- Once your feature has been approved by QA
- Rebase once again from the Release Branch
- Merge your changes into the Release Branch
- Push your changes upstream
- Delete your remote branch
“#{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]+)+$/
;-)
The Release Branch is rb_2012_04_03
Your Name is Super Developer
Your initials are sd
Your trello card number is 35
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
-
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
-
git checkout -b sd_35_country_validations
your initials + trello card number + small description (all lowercase)
-
#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"
-
git fetch
git rebase origin/rb_2012_04_03
-
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
- move your card from the ‘In Progress’ list to the ‘Test’ list
- add the qa person to the card
- add a comment to the card’s activity stream which will notify the appropriate qa person that was added in step 2
-
git fetch
git rebase origin/rb_2012_04_03
-
git checkout rb_2012_04_03
git merge sd_35_country_validations
-
git push origin rb_2012_04_03
-
git push origin :sd_35_country_validations
git push origin branch_name
git branch --set-upstream branch_name origin/branch_name
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.
- Use the master branch instead of the release branch
- ONLY have ONE commit(squashed)
- do NOT have a partial fix
A Git Workflow for Agile Teams
A successful Git branching model
The Case for Git Rebase
The ProGit Book
Trello