Git Setup Cheatsheet

Cover image

I had to setup several new machines during the past few months and at some point I got tired googling for the same websites every time I have to set up GIT. So I decided to write my Git Setup Cheatsheet:

Git Configuration

My identity:

$ git config --global "John Doe"
$ git config --global

My editor:

$ git config --global core.editor "atom --wait"

Git Terminal Shortcuts

Add to .gitconfig in my home:

  co = checkout
  ci = commit
  st = status
  br = branch
  hist = log --pretty=format:\"%h %ad | %s%d [%an]\" --graph --date=short
  type = cat-file -t
  dump = cat-file -p

A more up-to-date version of this file can be found in this gist.

Git Commands and Branch Names Auto-completion:

Get the auto-completion script:

$ curl -o ~/.git-completion.bash

Set it up in my .bash_profile:

if [ -f ~/.git-completion.bash ]; then
  . ~/.git-completion.bash

GitHub Keyboard Shortcuts

Add SSH to GitHub