Skip to content

Instantly share code, notes, and snippets.

@Larusso
Last active June 1, 2016 08:12
Show Gist options
  • Save Larusso/b341fe1db805710dfab80a542957e25f to your computer and use it in GitHub Desktop.
Save Larusso/b341fe1db805710dfab80a542957e25f to your computer and use it in GitHub Desktop.
[alias]
ci = commit
st = status
co = checkout
lg = !"git lg1"
graph = !"git lg"
lg1 = !sh -c \"git log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' $*\"
lg2 = !sh -c \"git log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' $*\"
lg3 = !sh -c \"git log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset) %C(bold cyan)(committed: %cD)%C(reset) %C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset)%n'' %C(dim white)- %an <%ae> %C(reset) %C(dim white)(committer: %cn <%ce>)%C(reset)' $*\"
submodule-ignore-on = submodule -q foreach 'git config --file $toplevel/.gitmodules submodule.$name.ignore "all"'
submodule-ignore-off = submodule -q foreach 'git config --file $toplevel/.gitmodules --unset submodule.$name.ignore'
graph-old = !sh -c \"git log --graph --abbrev-commit --decorate --date=relative --format=format:\\\"%C(bold blue)%H%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)\\\" $*\"
prune-all = !git remote | xargs -n 1 git remote prune
prune-merged = !git branch -d $(git branch --merged)
last-commit = !sh -c \"git log -1 --pretty=tformat:\\\"%H\\\" --author=\\\"`git config user.name`\\\" $*\"
alias = "!sh -c '[ $# = 2 ] && git config --global alias.\"$1\" \"$2\" && exit 0 || echo \"usage: git alias <new alias> <original command>\" >&2 && exit 1' -"
clone-fork = "!sh -c \"[ $# = 3 ] && git clone $1 $3 && cd $3 && git remote add upstream $2 && git fetch upstream && git checkout -b upstream_master --track upstream/master && git co @{-1} && exit 0 || echo \\\"usage: git clone-fork <fork-repository> <upstream-repository> <directory>\\\" >&2 && exit 1 \""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment