Skip to content

Instantly share code, notes, and snippets.

@agosto-calvinbehling
Created March 6, 2017 17:29
Show Gist options
  • Save agosto-calvinbehling/ebc453e966d825ec7fa7b124d8897610 to your computer and use it in GitHub Desktop.
Save agosto-calvinbehling/ebc453e966d825ec7fa7b124d8897610 to your computer and use it in GitHub Desktop.
git aliases
out log --pretty=oneline --abbrev-commit --graph @{u}..
in !git fetch && git log --pretty=oneline --abbrev-commit --graph ..${1:-@{u}} }
br checkout -b
cd checkout
co checkout
current rev-parse --abbrev-ref HEAD
cur rev-parse --abbrev-ref HEAD
recent !git reflog --date=local | head ${1:-}
graph log --graph --decorate --color --all --topo-order
hash rev-parse HEAD
top rev-parse --show-toplevel
home !cd $(git rev-parse --show-toplevel)
plz push --force-with-lease
please push --force-with-lease
commend commit --amend --no-edit
it !git init && git commit -m root --allow-empty
st status --short --branch
short status --short --branch
grog log --graph --abbrev-commit --decorate --all --format=format:"%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(dim white) - %an%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n %C(white)%s%C(reset)"
menf merge --no-ff
back !git checkout $(git reflog --grep-reflog=checkout -1 | sed -n 's/.*moving from \(\S*\) to \(\S*\)/\1/p')
mm !bash -c 'if [ $(git cur) == master ]; then git fetch && git merge --ff-only origin/master; else >&2 echo nay; fi'
alias !git config --get-regexp ^alias.* | cut -c7-
echo !echo $1 $2 #
ls log --pretty=format:%C(yellow)%h%Cred%d\ %Creset%s%Cblue\ [%cn] --decorate
ll log --pretty=format:%C(yellow)%h%Cred%d\ %Creset%s%Cblue\ [%cn] --decorate --numstat
lnc log --pretty=format:%h\ %s\ [%cn]
lds log --pretty=format:%C(yellow)%h\ %ad%Cred%d\ %Creset%s%Cblue\ [%cn] --decorate --date=short
ld log --pretty=format:%C(yellow)%h\ %ad%Cred%d\ %Creset%s%Cblue\ [%cn] --decorate --date=relative
le log --oneline --decorate
filelog log -u
fl log -u
dlc diff --cached HEAD^
dl !git ll -1
diffr !f() { git diff ${1:-HEAD}^..${1:-HEAD}; }; f
statr !f() { git ll ${1:-HEAD}^..${1:-HEAD}; }; f
f !git ls-files | grep -i
gr grep -Ii
gra !f() { A=$(pwd) && TOPLEVEL=$(git rev-parse --show-toplevel) && cd $TOPLEVEL && git grep --full-name -In $1 | xargs -I{} echo $TOPLEVEL/{} && cd $A; }; f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment