Skip to content

Instantly share code, notes, and snippets.

@debuti
Last active February 1, 2019 15:20
Show Gist options
  • Save debuti/e7dcbc72b786b008124d30c7519ec145 to your computer and use it in GitHub Desktop.
Save debuti/e7dcbc72b786b008124d30c7519ec145 to your computer and use it in GitHub Desktop.
My gitconfig and related utils
# Taken from https://gist.github.com/kevinchappell/09ca3805a9531b818579
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
PS1='${debian_chroot:+($debian_chroot)}\[\033[1;31m\]\u\[\033[1;37m\]@\[\033[1;32m\]\h\[\033[1;37m\]:\[\033[1;36m\]\w \[\033[1;35m\]$(parse_git_branch) \[\033[1;33m\]\$ \[\033[0m\]'
[http]
sslVerify = false
[user]
email = user@server
name = Your name
[credential]
helper = store
[push]
default = simple
[diff]
tool = meld
[difftool]
prompt = false
[difftool "meld"]
cmd = /usr/bin/meld "$LOCAL" "$REMOTE"
[merge]
tool = meld
[mergetool "meld"]
cmd = meld "$LOCAL" "$BASE" "$REMOTE" --output "$MERGED"
[alias]
st = "status"
ci = !"git commit"
co = !"git checkout"
lg = !"git lg1 --date-order"
lg1 = !"git lg1-specific --all"
lg2 = !"git lg2-specific --all"
lg3 = !"git lg3-specific --all"
lg1-specific = 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(auto)%d%C(reset)'
lg2-specific = 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(auto)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)'
lg3-specific = 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(auto)%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)'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment