2011-09-05 12:19:31 -06:00
|
|
|
[alias]
|
2014-05-05 00:15:31 -06:00
|
|
|
l = log --pretty=oneline --graph
|
2011-09-05 12:19:31 -06:00
|
|
|
s = status -s
|
|
|
|
c = clone --recursive
|
2014-04-17 12:51:21 -06:00
|
|
|
ff = merge --ff-only
|
|
|
|
ca = !git add -A && git commit -av
|
|
|
|
tb = rev-parse --abbrev-ref --symbolic-full-name @{u}
|
2014-10-22 03:20:44 -06:00
|
|
|
rh = reset --hard
|
2014-04-17 12:51:21 -06:00
|
|
|
cam = commit -am
|
|
|
|
poh = push origin HEAD
|
|
|
|
pohm = push origin HEAD:master
|
|
|
|
suir = submodule update --init --recursive
|
|
|
|
amend = commit -a --amend -C HEAD
|
|
|
|
modified = diff HEAD --name-only
|
|
|
|
untracked = "!u() { git status -s | grep "??" | awk '{print $2}'; }; u"
|
|
|
|
dirty = "!t() { test -n \"$(git status --porcelain)\"; }; t"
|
|
|
|
# diff tracking branch merge base
|
|
|
|
dtbmb = !git diff `git tb`...HEAD
|
|
|
|
root = rev-parse --show-toplevel
|
|
|
|
ignore = "!i() { printf \"\n$1\" >> "`git root`/.gitignore"; }; i"
|
2014-06-10 17:00:48 -06:00
|
|
|
ignore-untracked="!git untracked | xargs -n1 git ignore"
|
2014-04-17 12:51:21 -06:00
|
|
|
power-clean = clean -ffd
|
|
|
|
db = !"db() { git diff HEAD~"$1"; }; db"
|
2014-10-13 03:50:57 -06:00
|
|
|
clone = clone --recursive
|
2014-04-14 21:24:52 -06:00
|
|
|
|
2014-04-17 12:51:21 -06:00
|
|
|
branches = branch -a
|
2011-09-05 12:19:31 -06:00
|
|
|
remotes = remote -v
|
2014-04-14 21:24:52 -06:00
|
|
|
|
2014-04-17 12:51:21 -06:00
|
|
|
which-branch = "!wb() { b="$(git symbolic-ref HEAD)" && echo ${b#refs/heads/}; }; wb"
|
|
|
|
sha = rev-parse HEAD
|
|
|
|
branch-or-sha = "!bs() { git which-branch 2> /dev/null || git sha 2> /dev/null ; }; bs"
|
|
|
|
# In newer versions of git, this simpler definition of which-branch would work.
|
|
|
|
# symbolic-ref HEAD --short
|
|
|
|
|
2014-11-05 08:15:27 -07:00
|
|
|
ffr = "!ffr() { git fetch $1 && git ff $1/$(git which-branch) && git suir; }; ffr"
|
2014-04-17 12:51:21 -06:00
|
|
|
ffo = !git ffr origin
|
|
|
|
reset-origin = "!r() { git reset --hard origin/\"$(git which-branch)\" && git suir; }; r"
|
2014-06-10 17:00:48 -06:00
|
|
|
reset-author ="!source ~/.lib/shellrc/functions.sh && git_reset_author"
|
2014-04-14 21:24:52 -06:00
|
|
|
|
2011-09-05 12:19:31 -06:00
|
|
|
# Credit an author on the latest commit
|
|
|
|
credit = "!f() { git commit --amend --author \"$1 <$2>\" -C HEAD; }; f"
|
|
|
|
# Interactive rebase with the given number of latest commits
|
|
|
|
reb = "!r() { git rebase -i HEAD~$1; }; r"
|
2014-06-10 17:00:48 -06:00
|
|
|
# Diff a file or show it in git's pager if it is untracked
|
|
|
|
du = "!d() { git ls-files $1 --error-unmatch 2>/dev/null 1>/dev/null && git diff $1 || `git config --get core.pager` $1; }; d"
|
|
|
|
clean-branches = "!r() { git branch -r --merged ${1-origin/master} | xargs -n1 git branch -d; }; r"
|
2014-10-13 03:50:57 -06:00
|
|
|
diff-excluding = "!f() { exclude=$1; shift; git diff $1 $2 --name-only | grep -v $exclude | xargs git diff "$@" --; }; f"
|
|
|
|
aliases = "!f() { git config --get-regexp ^alias | cut -c 7-; }; f"
|
2014-10-21 18:34:42 -06:00
|
|
|
file-exists = "!f() { git ls-files $1 --error-unmatch > /dev/null 2> /dev/null; }; f"
|
|
|
|
shas = log HEAD --pretty=format:%H
|
2014-04-14 21:24:52 -06:00
|
|
|
|
2011-09-05 12:08:58 -06:00
|
|
|
[core]
|
2011-09-05 12:19:31 -06:00
|
|
|
# Use custom `.gitignore` and `.gitattributes`
|
|
|
|
excludesfile = ~/.gitignore
|
|
|
|
attributesfile = ~/.gitattributes
|
2014-04-17 12:51:21 -06:00
|
|
|
pager = less -F -X
|
2011-09-05 12:19:31 -06:00
|
|
|
|
2011-09-05 12:08:58 -06:00
|
|
|
[color]
|
2014-04-08 05:27:02 -06:00
|
|
|
# Use colors in Git commands that are capable of colored output when
|
2014-04-17 12:51:21 -06:00
|
|
|
# outputting to the terminal
|
2011-09-05 12:19:31 -06:00
|
|
|
ui = auto
|
2014-04-08 05:27:02 -06:00
|
|
|
|
2011-09-05 12:08:58 -06:00
|
|
|
[color "branch"]
|
2011-09-05 12:19:31 -06:00
|
|
|
current = yellow reverse
|
|
|
|
local = yellow
|
|
|
|
remote = green
|
2014-04-08 05:27:02 -06:00
|
|
|
|
2011-09-05 12:08:58 -06:00
|
|
|
[color "diff"]
|
2011-09-05 12:19:31 -06:00
|
|
|
meta = yellow bold
|
|
|
|
frag = magenta bold
|
|
|
|
old = red bold
|
|
|
|
new = green bold
|
2014-04-08 05:27:02 -06:00
|
|
|
|
2011-09-05 12:08:58 -06:00
|
|
|
[color "status"]
|
2014-09-09 21:31:27 -06:00
|
|
|
added = green
|
|
|
|
changed = yellow
|
|
|
|
untracked = red
|
2011-09-05 12:19:31 -06:00
|
|
|
|
2013-09-30 23:21:02 -06:00
|
|
|
[user]
|
|
|
|
email = IvanMalison@gmail.com
|
|
|
|
name = Ivan Malison
|
2014-04-08 05:27:02 -06:00
|
|
|
|
2013-11-22 11:52:22 -07:00
|
|
|
[merge]
|
2014-04-17 12:51:21 -06:00
|
|
|
conflictstyle = diff3
|