Skip to content

Instantly share code, notes, and snippets.

@angajime
Last active August 29, 2015 14:21
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save angajime/f9cd5fcc0d4080e20201 to your computer and use it in GitHub Desktop.
Save angajime/f9cd5fcc0d4080e20201 to your computer and use it in GitHub Desktop.
Git Cookbook

GIT COOKBOOK

INFO

What is this?

Why?

LINKS

Books and Guides

gitflow-workflow (atlassian.com)

RECIPES

git branch

git branch        # local branches
git branch -a     # local and remote branches

git checkout

git checkout -b branch-123 origin/branch-123        # clone remote branch branch-123 to local branch branch-123

git rebase

git log --oneline
0123456 3rd commit
abcdefg 2nd commit
b6600b9 1st commit
# We want to combine 2nd and 3rd commit
git rebase -i b6600b9
# We will get prompted for this info:
pick abcdefg
squash 0123456
# And we are done:
git log --oneline
7854452 2nd commit & 3rd commit combined
b6600b9 1st commit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment