Skip to content

Instantly share code, notes, and snippets.

@hohonuuli
Last active October 10, 2017 19:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hohonuuli/11222814 to your computer and use it in GitHub Desktop.
Save hohonuuli/11222814 to your computer and use it in GitHub Desktop.
PS1=$'\n\[\033[35m\]\u@\h:$PWD`git branch 2> /dev/null | grep -e ^* | sed s/"* "// | sed s/^/"\[\033[31\]m ⏣ \[\033[0;32m\]"/`\n\[\033[35m\] \[\033[m\]'
[alias]
#Show all branches
branches = branch -a
# Show conflicted files after a merge
conflicted = grep --name-only --full-name '<<<<<<< HEAD'
# Grep - search for occurence of term in all git managed files
gr = grep -Ii
# Linearlized change history
ls = log --pretty=format:%C(red)%h%Cgreen%d\\ %Creset%s%Cblue\\ <%cn> --decorate
# Linearlized change history in long format
ll = log --pretty=format:%C(red)%h%Cgreen%d\\ %Creset%s%Cblue\\ <%cn> --decorate --numstat
# List ignored files
ls-ignored = ls-files --exclude-standard --ignored --others
# Short History (tags, last 2 commits and related branches)
sh = log --graph --all --simplify-by-decoration --decorate --pretty=format:'%Cred%h%Creset - %C(yellow)%cd%Creset -%C(green)%d%Creset %s %C(bold blue)<%an>%Creset' --date=short
# Short History (tags, last 2 commits and related branches) using relative date
shr = log --graph --all --simplify-by-decoration --decorate --pretty=format:'%Cred%h%Creset - %C(yellow)%cd%Creset -%C(green)%d%Creset %s %C(bold blue)<%an>%Creset' --date=relative
# Full history graph
fh = log --graph --all --pretty=format:'%Cred%h%Creset - %C(yellow)%cd%Creset -%C(green)%d%Creset %s %C(bold blue)<%an>%Creset' --abbrev-commit --date=short
# Full History with relative date
fhr = log --graph --all --pretty=format:'%Cred%h%Creset - %C(yellow)%cd%Creset -%C(green)%d%Creset %s %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
# Show info about last commit
last = log -1 HEAD --stat --date=iso
# Show last tag
lasttag = describe --tags --abbrev=0
# Show diffs of recent changes
news = log --word-diff=color -p HEAD@{1}..HEAD@{0}
# Show the remote origin
origin = remote show origin
# Show all remotes
origins = remote -v
# Show root of current git repo
root = rev-parse --show-toplevel
# Short version of status. Output looks Similar to svn status
st = status --short --branch
# Do diff using a word diff instead of a line diff
wd = diff --word-diff
# Show author full name (e.g. git author brian)
whois = !sh -c 'git log -i -1 --pretty=\"format:%an <%ae>\n\
\" --author=\"$1\"' -
# Show a release log
releasenotes = log --pretty=format:'- %s%n%b' --since='$(git show -s --format=%ad `git rev-list --tags --max-count=1`)'
springcleaning = for-each-ref --sort=-committerdate --format='%(refname:short) %(committerdate:short)'
# List all aliases
alias = ! git config --get-regexp ^alias\\. | sed -e s/^alias\\.// -e s/\\ /\\ =\\ /
[push]
default = matching
[user]
email = bschlining@gmail.com
name = Brian Schlining
[difftool "Kaleidoscope"]
cmd = ksdiff --partial-changeset --relative-path \"$MERGED\" -- \"$LOCAL\" \"$REMOTE\"
[diff]
tool = Kaleidoscope
[difftool]
prompt = false
[mergetool "Kaleidoscope"]
cmd = ksdiff --merge --output \"$MERGED\" --base \"$BASE\" -- \"$LOCAL\" --snapshot \"$REMOTE\" --snapshot
trustExitCode = true
[mergetool]
prompt = false
[merge]
tool = Kaleidoscope
[core]
editor = mate
excludesfile = /Users/brian/.gitignore_global
[color]
ui = true
[difftool "sourcetree"]
cmd = /usr/local/bin/ksdiff -w \"$LOCAL\" \"$REMOTE\"
path =
[mergetool "sourcetree"]
cmd = /usr/local/bin/ksdiff --merge --output \"$MERGED\" --base \"$BASE\" -- \"$LOCAL\" --snapshot \"$REMOTE\" --snapshot
trustExitCode = true
[github]
user = hohonuuli
password = your-password
[filter "lfs"]
clean = git-lfs clean %f
smudge = git-lfs smudge %f
required = true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment