Skip to content

Instantly share code, notes, and snippets.

@lukewaite
Last active August 29, 2015 14:14
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 lukewaite/15b2e411c0be093e29b7 to your computer and use it in GitHub Desktop.
Save lukewaite/15b2e411c0be093e29b7 to your computer and use it in GitHub Desktop.
ITIS Git Flow
  1. Update master
  • git checkout master - Switch to master
  • git fetch --all - Pull down metadata from all remotes
  • git merge origin master - Merge changes from origin master into your current branch
  1. Create feature branch
  • git checkout -b [feat/fix]-<Ticket>-<Description> - Create new branch
  • git push -u origin <branch name> - Push branch to remote "origin" and set as upstream
  1. DEVELOP! (Rinse and Repeat)
  • Commit early, commit often - include the ticket # in commit messages
  • Fetch & merge changes regularly, and rebase if needed.
  • Push at end of the day
  1. Merge to staging
  • (Optional): Create a new staging branch for your staging.
  • git checkout -b <branch name>-staging
  • git push -u origin <branch name>-staging
  • git fetch --all
  • git rebase -i origin/staging
  • Squash your changes
  1. Merge to master
  • DO NOT BASE OFF YOUR STAGING REBASE
  • git checkout <branch-name> - Get off your staging rebased branch
  • git fetch --all
  • git rebase -i origin/master
  • Squash your changes
Try to make a habit of breaking out from your IDE. Use the command line to interact with git!
Also - check out this free course!
https://www.codeschool.com/courses/try-git
After you do the introductory git course, the others are worth it, but you can also check out:
https://www.youtube.com/watch?v=m1AUMnPeRfs
BrowserSync is a good tool for testing and sharing with others:
http://www.browsersync.io/
Atlassian has a great Git tutorial with a rebase section:
https://www.atlassian.com/git/tutorials/rewriting-history/git-rebase-i
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment