Skip to content

Instantly share code, notes, and snippets.

@danish-rehman
Last active August 29, 2015 14:13
Show Gist options
  • Save danish-rehman/c18a2f802f4ff96d6805 to your computer and use it in GitHub Desktop.
Save danish-rehman/c18a2f802f4ff96d6805 to your computer and use it in GitHub Desktop.
Git config
function parse_git_branch {
ref=$(git symbolic-ref HEAD 2> /dev/null) || return
ref=${ref#refs/heads/}
unpushed=$(git log -- origin/$ref..$ref 2> /dev/null) || return
if [ "$unpushed" ]; then
    warn=' - UNPUSHED!'
fi
echo "("$ref$warn")"
}
[alias]
diffw = diff --color-words
lol = log --graph --decorate --pretty=oneline --abbrev-commit
lola = log --graph --decorate --pretty=oneline --abbrev-commit --all
glog = log --graph --full-history --all --color --date=short --pretty=format:'%x1b[31m%h%x09%x1b[32m%d%x1b[0m%x20%ad %aE %s'
merge = merge --no-ff
[core]
whitespace=fix,-indent-with-non-tab,trailing-space,cr-at-eol
[color]
ui = auto
[user]
name = Danish Rehman
email = [email protected]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment