Skip to content

Instantly share code, notes, and snippets.

@davidnguyen11
Last active March 2, 2020 08:29
Show Gist options
  • Save davidnguyen11/285c2cdbea2b521dd4106012d1473109 to your computer and use it in GitHub Desktop.
Save davidnguyen11/285c2cdbea2b521dd4106012d1473109 to your computer and use it in GitHub Desktop.
vim ~/.gitconfig
[alias]
  aa = add --all
  br = branch
  bv = branch -vv
  ba = branch -ra
  bd = branch -d
  ca = commit --amend --no-edit
  caa = commit -a --amend --no-edit
  co = checkout
  cob = checkout -b
  cm = commit -m
  di = diff
  ll = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --numstat
  ld = log --pretty=format:"%C(yellow)%h\\ %C(green)%ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=short --graph
  ls = log --pretty=format:"%C(green)%h\\ %C(yellow)[%ad]%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=relative
  mm = merge --no-ff
  st = status --short --branch
  tg = tag -a
  pu = push --tags
  po = push origin
  pf = push --force origin
  un = reset --hard HEAD
  uh = reset --hard HEAD^
  l = log --pretty=format:'%C(yellow)%h %C(red)%ad %C(cyan)%an %C(green)%d %C(reset)%s' --date=short
  ec = config --global -e
  up = !git pull --rebase --prune $@ && git submodule update --init --recursive
  ri = rebase --interactive
  rc = rebase --continue

Usage

git commit -m "This is a commit message"

g cm "This is a commit message"

git branch"

g br

So on...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment