Skip to content

Instantly share code, notes, and snippets.

@wm
Created January 21, 2011 14:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wm/789738 to your computer and use it in GitHub Desktop.
Save wm/789738 to your computer and use it in GitHub Desktop.
My Git Work flow
~ $ cd MyProject.git
(master) MyProject.git $ git pull # Get main branch up to date
(master) MyProject.git $ git checkout -b 100-new-style # create story branch to do development in
(100-new-style) MyProject.git $ vim public/stylesheets/main.css # make some modifications
(100-new-style) MyProject.git $ vim public/stylesheets/two.css # make some modifications
(100-new-style) MyProject.git $ vim public/stylesheets/three.css # make some modifications
(100-new-style) MyProject.git $ git add public # Add our changes
(100-new-style) MyProject.git $ git commit -m "Re #100. Added border to our pages" # commit local changes
(100-new-style) MyProject.git $ git checkout master # change back to main branch
(master) MyProject.git $ git pull # Get upstream changes (they will be fast forwarded)
(master) MyProject.git $ git checkout 100-new-style # Back to story branch
(100-new-style) MyProject.git $ git rebase master # Apply the upstream changes to our branch
# Here you can continue to develop on your branch repeating the above process every so often.
# Once you are ready to push to the upstream server you should ensure you master is up to date
# and has been rebased onto your story branch (as described above) then do the following
(100-new-style) MyProject.git $ git checkout master # change back to main branch
(master) MyProject.git $ git merge 100-new-style # merge in the changes onto master
(master) MyProject.git $ git push # push changes upstream
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment