From ed09cf4f216cdb902ccb3ebb4c45b42774949306 Mon Sep 17 00:00:00 2001 From: Nikolas Weger Date: Fri, 17 Jul 2015 11:23:59 +0200 Subject: [PATCH] Stuff --- files/gitconfig | 95 ++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 94 insertions(+), 1 deletion(-) diff --git a/files/gitconfig b/files/gitconfig index a7a7bb0..c06c47e 100644 --- a/files/gitconfig +++ b/files/gitconfig @@ -1,7 +1,100 @@ [user] email = nikolasweger@googlemail.com name = Nikolas Weger + +[alias] + exec = ! "exec" + st = status -sb + br = branch -vv + bra = branch -vv --all + bed = branch --edit-description + aa = add --all :/ + ci = commit -v + ca = commit --amend -v + save = commit -a -m "Save" + co = checkout + di = diff + dis = diff --stat + diw = diff --color-words + dic = diff --color-words=. + dc = diff --cached + dcs = diff --cached --stat + dcw = diff --cached --color-words + dcc = diff --cached --color-words=. + dh = diff HEAD~ + dhs = diff HEAD~ --stat + dhw = diff HEAD~ --color-words + dhc = diff HEAD~ --color-words=. + grp = grep -C 1 + ff = merge --ff-only + noff = merge --no-ff + fa = fetch --all + deleted = remote prune --dry-run + prunable = ! "pr() { git remote | xargs -L 1 git deleted; }; pr" + pruneall = ! "pa() { git remote | xargs -L 1 git remote prune; }; pa" + pullff = pull --ff-only + pullrb = pull --rebase + mirror-remote = ! "mr() { git push \"${2}\" \"refs/remotes/${1}/*:refs/heads/*\" && git remote set-head \"${2}\" -a; }; mr" + count = diff --stat "4b825dc642cb6eb9a060e54bf8d69288fbee4904" # hash of empty tree + credit = shortlog -sn + linecredit = ! "lc() { git ls-tree --name-only -z -r HEAD | xargs -0 -n1 git diff --no-index --numstat /dev/null 2>/dev/null | grep -v '^-' | cut -f 3- | cut -d ' ' -f 3- | xargs -n1 git blame --line-porcelain | grep '^author ' | cut -d ' ' -f 2- | sort | uniq -c | sort -nr; }; lc" + cc = rev-list HEAD --count + cca = rev-list --all --count + lg = log -p + gr = log --graph --format=compact # graph + grl = log --graph --format=line # graph line + grd = log --graph --format=detail # graph detail + gra = log --graph --format=compact --all # graph all + gral = log --graph --format=line --all # graph all line + grad = log --graph --format=detail --all # graph all in detail + sf = show --format=fuller + sfs = show --format=fuller --stat + info = ! "inf() { if git rev-parse ${1} >/dev/null 2>&1; then git cat-file -p $(git rev-parse ${1}); else echo Invalid object; fi }; inf" + cleanall = clean -fdx # this is dangerous, so it's intentionally long to type + update-submodules = submodule update --init --recursive + upgrade-submodules = submodule update --init --remote + empty-tree-hash = hash-object -t tree /dev/null + root = rev-parse --show-toplevel + ctags = ! "ctg() { trap \"rm -f .git/tags.$$\" EXIT; ctags --tag-relative -Rf.git/tags.$$ --exclude=.git; mv .git/tags.$$ .git/tags; }; ctg" + tar = ! "tar() { git archive --format tar --prefix=\"${PWD##*/}/\" HEAD -o ${1}; }; tar" + targz = ! "targz() { git archive --format tar.gz --prefix=\"${PWD##*/}/\" HEAD -o ${1}; }; targz" + zip = ! "zip() { git archive --format zip --prefix=\"${PWD##*/}/\" HEAD -o ${1}; }; zip" + +[color] + ui = auto + +[color "grep"] + match = cyan bold + selected = blue + context = normal + filename = magenta + linenumber = green + separator = yellow + function = blue + +[pretty] + line = "%C(auto)%h%d %s %C(yellow)by %C(blue)%an %C(green)%ar" + compact = "%C(auto)%h %s %C(green)%ar%n %C(auto)%d%n" + detail = "%C(auto)%h %s%n %C(yellow)by %C(blue)%an %C(magenta)<%ae> [%G?] %C(green)%ar%n %C(auto)%d%n" + +[merge] + defaultToUpstream = true + tool = vimdiff + +[mergetool] + keepBackup = false + [push] - default = simple + default = upstream + +[credential] + helper = cache --timeout=3600 + +[grep] + lineNumber = true + +[advice] + detachedHead = false + [core] excludesfile = ~/.gitignore_global