Home > tips > A typical workflow for a team using Git

A typical workflow for a team using Git

Lets assume you are in a team, working on a Rails project and you have chosen Git as your version control system. One way to complete a working cycle from pull to push is:

DISCLAIMER: There are more ways and many situations that are not described here. This is only a note to self that may also be useful to you.

Pull from your remote repository to make sure everything is up to date

git pull origin master

Create a new local branch for keeping your changes way from your local master branch

git branch my_new_feature

Switch to that branch and start working

git checkout my_new_feature

After finishing work and running successfully any cukes/specs/tests, commit

git commit -am "Implemented my new super duper feature"

Then, switch back to local master and pull if you need to also merge any changes since you first pulled

git checkout master
git pull origin master

Merge the local feature branch to master and run any cukes/specs/tests and if everything passes push changes

git merge my_new_feature
git push origin master

This is my preference: I delete the temporary local branch when everything is merged and pushed

git branch -d my_new_feature

Update – Here is a more sophisticated approach: Agile git and the story branch pattern

Categories: tips Tags: , , ,
  1. Nick Kokkos
    December 5th, 2009 at 17:31 | #1

    That was nice. Thanks for this article; exactly what I needed to check out merging with git.

  2. December 6th, 2009 at 01:24 | #2

    @Nick Kokkos

    Thanks Nick! Always glad to help other developers :-)

  1. No trackbacks yet.