Skip to content

Instantly share code, notes, and snippets.

@andrewwheal
Last active October 17, 2018 02:13
Show Gist options
  • Save andrewwheal/9d50f28a2cecb349627f to your computer and use it in GitHub Desktop.
Save andrewwheal/9d50f28a2cecb349627f to your computer and use it in GitHub Desktop.
git-commands

moving branches

  • git branch -f <branch> [<destination>]
  • git hoist <branch> [<destination>]
  • git ff [<destination>]
  • git catchup [<branch>] [<remote>]

updating submodules

  • git subup

diff all the things

  • git diff
  • git diff --cached
  • git cdiff

convenient pushing

  • git cpush [<remote>]
  • git fpush [<remote>]

reverting

  • git revert [--no-commit] <commit>...

changes on live

  • git --no-pager diff > /tmp/name.patch
  • scp gitpush@ecom1.iomart:/tmp/name.patch .
  • git apply --ignore-space-change --ignore-whitespace name.patch

(un)staging

  • git add [<file>...]
  • git stage [<file>...]
  • git unstage [<file>...]
  • git add -p
  • git unstage -p

moving around

  • git ssh <remote>
  • gcd <remote>

stashing

  • git stash [save [<message>]]
  • git stash pop
  • git sco <branch>

pretty log

  • git lgg
  • git log --graph --decorate --oneline [--branches --remotes --tags --all --color]

information is power

  • git authors
  • git committers
  • git commands
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment