Skip to content

Instantly share code, notes, and snippets.

@dwayne
Last active December 24, 2016 23:30
Show Gist options
  • Save dwayne/3003724 to your computer and use it in GitHub Desktop.
Save dwayne/3003724 to your computer and use it in GitHub Desktop.
Setting up Git

Git Quick Start

Install git

$ sudo apt-get install git

User settings

$ git config --global user.name "Dwayne R. Crooks"
$ git config --global user.email "me@dwaynecrooks.com"

Core settings

$ git config --global core.editor nano
$ git config --global core.excludesfile $HOME/.gitignore_global

or you can use Sublime Text 2 as the default editor

$ git config --global core.editor "subl -n -w"

Contents of $HOME/.gitignore_global

*~

Other settings

$ git config --global color.ui true

Useful aliases

Add to .gitconfig

[alias]
  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

Add to .bashrc

alias gs='git status '
alias ga='git add '
alias gb='git branch '
alias gc='git commit '
alias gd='git diff '
alias go='git checkout '
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment