Skip to content

Instantly share code, notes, and snippets.

@bloudermilk
Created March 20, 2013 23:48
Show Gist options
  • Save bloudermilk/5209554 to your computer and use it in GitHub Desktop.
Save bloudermilk/5209554 to your computer and use it in GitHub Desktop.
A simple git workflow
#
# Starting
#
# Start a new feature branch
git checkout -b my_feature
# Make changes
# Add/Commit
git add .
git commit -m "So much awesome stuff"
# Push to remote branch
git push origin my_feature
#
# Iterating
#
# Make more changes
# Add/Commit new changes
git add .
git commit -m "Even more awesome stuff"
# Download all remote changes on all branches
git fetch
# Rebase any changes from master
git rebase origin master
# Push to remote (must force since we're rewritten history by rebasing master
git push --force origin my_feature
#
# Merging
#
# Get all the remote branch
git fetch
# Checkout master
git checkout master
# Merge feature
git merge origin/my_feature
# Push to remote
git push origin master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment