Skip to content

Instantly share code, notes, and snippets.

@hmorri32
Last active November 29, 2017 02:51
Show Gist options
  • Save hmorri32/4d3ffd40e39305c3da6e178b12d295c9 to your computer and use it in GitHub Desktop.
Save hmorri32/4d3ffd40e39305c3da6e178b12d295c9 to your computer and use it in GitHub Desktop.

Checkout a new working branch

 git checkout -b <branchname> --track

Make Changes

 git add
 git commit -m "description of changes"

Sync with remote

 git checkout master
 git fetch --prune
 git pull --rebase

Update branch

 git checkout <branchname>
 git rebase master

Push Changes

 git checkout master
 git merge <branchname>
 git push

Squash Last N Commits

 git rebase --interactive HEAD~N
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment