Skip to content

Instantly share code, notes, and snippets.

@renodesper
Created August 8, 2020 15:16
Show Gist options
  • Save renodesper/dca1ce0408c90bb6f213f0e2d56a8350 to your computer and use it in GitHub Desktop.
Save renodesper/dca1ce0408c90bb6f213f0e2d56a8350 to your computer and use it in GitHub Desktop.

Revisions

  1. renodesper created this gist Aug 8, 2020.
    43 changes: 43 additions & 0 deletions .gitconfig
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,43 @@
    [alias]
    a = add
    ai = add --interactive
    b = branch
    bs = bisect
    c = commit
    ca = commit --amend
    cam = commit --amend -m
    cm = commit -m
    co = checkout
    cob = checkout -b
    coh = checkout HEAD --
    cl = clone
    cp = cherry-pick
    d = diff
    di = !"d() { git diff --patch-with-stat HEAD~$1; }; git diff-index --quiet HEAD -- || clear; d" # `git di $number` shows the diff between the state `$number` revisions ago and the current state
    dt = difftool
    f = fetch
    fo = fetch origin
    fp = fetch --prune
    fu = fetch upstream
    g = grep
    gp = grep -p
    l = log --color --graph --pretty=format:'%C(yellow)%h%d %C(reset)%s %C(green)(%cr) %C(blue)<%an>' --abbrev-commit --
    m = merge
    mm = merge master
    p = pull
    ps = push
    psf = push --force-with-lease
    r = remote
    rb = rebase
    rs = reset
    rv = revert
    s = status -sb
    st = stash
    t = tag
    u = reset HEAD^
    uh = reset --hard HEAD^
    us = reset --soft HEAD^
    aliases = !git config -l | grep alias | cut -c 7- # List git aliases
    last = for-each-ref — sort=-committerdate refs/heads/
    what = whatchanged
    who = shortlog -n -s --no-merges