Skip to content

Instantly share code, notes, and snippets.

@yihyang
Created September 21, 2015 04:18
Show Gist options
  • Save yihyang/c439a9415d7f01b13922 to your computer and use it in GitHub Desktop.
Save yihyang/c439a9415d7f01b13922 to your computer and use it in GitHub Desktop.
Cheat Sheets for git (Advanced)
# Checkout previous commit and saves it into a branch
git checkout -b <new_branch_name> <commit code>
## Comparing modified file in single line between branches
# This one shows in "M abc.html" format
git diff --name-status master..branchName
# This one shows in "Gemfile.lock | 39 +----" format
git diff --stat --color master..branchName
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment