Skip to content

Instantly share code, notes, and snippets.

@jasonhinkle
Last active February 24, 2016 03:07
Show Gist options
  • Save jasonhinkle/4fb0155a0c57d4dcb641 to your computer and use it in GitHub Desktop.
Save jasonhinkle/4fb0155a0c57d4dcb641 to your computer and use it in GitHub Desktop.
Branch Workflow
# INITIAL SETUP
# make sure you are working with the most recent code
git pull
# create branch & optionally add it to remote origin
git checkout -b <branchname>
git push -u origin <branchname>
# REGULAR WORKFLOW
# make changes & do normal add/commit/push workflow, pushing only if a remote branch was created
git add .
git commit -m "check-in message"
git push
# FINISH WORK AND MERGE
# when ready to merge into master
git checkout master
git pull
git merge <branchname>
git push
# if necessary to rebase
# TODO - write this
# CLEANUP OPERATIONS
# if necessary to undo a commit:
git reset --hard 91c27777543ccfcb03769cdd8f6777df055ef479
git push --force
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment