General documentation / cheat sheets for various languages and services


git status
On branch master Your branch is ahead of 'origin/master' by 1 commit. (use "git push" to publish your local commits) Changes to be committed: (use "git reset HEAD ..." to unstage) modified: app.jsx modified: site.less Changes not staged for commit: (use "git add ..." to update what will be committed) (use "git checkout -- ..." to discard changes in working directory) modified: build/bundle.js
git status -s
git status --short
M app.jsx M build/bundle.js M site.less
git branch -d fix-app-loader
Delete the fix-app-loader local branch only if it has been merged.
git branch -D demo-app-loader-idea
Delete the demo-app-loader-idea local branch even if it hasn't been merged.
git push origin --delete pr-2042
git push origin :pr-2042
Delete the pr-2042 remote branch.
git show HEAD^ --color-words
Show word-level patch diff of second-to-last commit. Deletes are red, additions are green.
git log --oneline --graph --all --decorate --simplify-by-decoration
  • --oneline pretty prints the commit hash and message to fit on one line.
  • --graph draws a tree-stylized graph of the different branches
  • --all include all available refs, not just the ones headed to the current branch (I think that's what it does)
  • --decorate prints the branch(es) terminating at that commit.
  • --simplify-by-decoration omits commits that are not decorated (which are usually less significant commits)