Skip to content

Instantly share code, notes, and snippets.

@davidjguru
Last active February 18, 2018 12:10
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 davidjguru/065834d83d332f3e23b0a7dacb3610fa to your computer and use it in GitHub Desktop.
Save davidjguru/065834d83d332f3e23b0a7dacb3610fa to your computer and use it in GitHub Desktop.
Git & Branches
## Create new branch and switch to it at the same time.
git checkout -b newbranch
## This is shorthand for:
## git branch newbranch
## git checkout newbranch
## Basic Merging
git checkout master
## Switched to branch 'master'
git merge newbranch
## Merge newbranch from master
## Delete newbranch
git branch -d newbranch
## Show branches local and remotes
git branch -a
## Show remotes
git branch -r
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment