-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgitconfig
More file actions
64 lines (58 loc) · 3.34 KB
/
gitconfig
File metadata and controls
64 lines (58 loc) · 3.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
[color]
ui = auto
# some visible colors for diff
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "diff"]
commit = cyan bold
meta = yellow
frag = magenta bold
old = red
new = green
whitespace = red reverse
[color "status"]
added = yellow
changed = green
untracked = cyan
[core]
whitespace=fix,-indent-with-non-tab,trailing-space,cr-at-eol # show whitespace "problems"
pager = less -X -F # set pager ( default is whatever system default pager is )
editor = vim # default editor ( default is $EDITOR, or if not defined default editor in distro)
# some sane defaults for branching and pushing
[push]
default = current #push only current branch to avoid mistakes
[branch]
autosetupmerge = true # set up new branches to automatically track remote ones
# -S means sign commit with GPG key
[alias]
l = !"f() { (git sync && git ll $*)|less -X -F -R ; } ; f "
ll = !"f() { git log --color=always --abbrev-commit --no-prefix --relative-date --format='=== %Cred%h%Creset sign:%G? %Cgreen%aN %Cblue%x09%ai [%ar] %Creset %s' $* | perl -MTerm::ANSIColor -p -e 's/ sign:.G. / /;s/sign:(.)/$c=(\"$1\"=~\"([GU])\")?\"yellow\":\"magenta\";$c=(\"$1\"=~\"([U])\")?\"red\":$c;colored [$c], \"$1\"/e;s/($ENV{LOGNAME}|#?\\d{16})/colored [\"cyan\"], \"$1\"/ge' | less -X -F -R ; } ; f "
ls-unsigned = !"f() { git log --pretty='format:%H|%aN|%s|%G?' \"${1:-HEAD}\" | grep -v \"|G$\" ; } ; f " # http://mikegerwitz.com/papers/git-horror-story#automate
ls-untrusted = !"f() { git log --pretty='format:%H|%aN|%s|%G?' \"${1:-HEAD}\" | grep \"|U$\" ; } ; f " # http://mikegerwitz.com/papers/git-horror-story#automate
show-signature = !"f() { git show --show-signature $* ; } ; f "
today = !"git l --since=$(date +%Y-%m-%dT00:00)"
yesterday = !"git ll --until=$(date +%Y-%m-%dT00:00) --since=$(date -d '-1 day' +%Y-%m-%dT00:00)"
week = !"git ll --since=$(date -d '-7 day' +%Y-%m-%dT00:00)"
co = checkout
c = commit --verbose -e
ci = commit --verbose -e -a
cis = commit --verbose -e -a -S # -S - sign commit with GPG key
sync = !"(git pull && git push -u && /bin/echo -en 'Success\n\n') 2>&1" # bang! means shell command, else it defaults to git commands only
wip = !"f() { s=\"$*\" ; if [ ! -z \"$s\" ] ; then echo \"finding($s)\" ; git stash list stash^{/$s} -p ; else git stash list ; fi }; f"
wipshow = !"f() { s=\"$*\" ; if [ ! -z \"$s\" ] ; then echo \"finding($s)\" ; git stash show stash^{/$s} -p ; else git stash show ; fi }; f"
wipload = !"f() { s=\"$*\" ; if [ ! -z \"$s\" ] ; then echo \"finding($s)\" ; git stash pop stash^{/$s} ; else git stash show ; fi }; f"
wipsave = stash save
rmbranch = removebranch # script in /usr/libexec/git-core/git-removebranch
rollback = !"git revert -e -n $* && git ci # "
index = !"ctags -R -f ./.git/tags ."
refs = for-each-ref --format='%(authorname) %09 %(refname) %09 %(committerdate)'
asq =!"git config user.name asquelt && git config user.email asq@asq.pm && echo \"GIT author set to asquelt <asq@asq.pm>\""
pushall = !"f() { for i in $(git remote); do echo :git push $i $*; git push $i $*; done; } ; f"
pullall = !"f() { for i in $(git remote); do echo :git pull $i $*; git pull $i $*; done; } ; f"
# software to use with 'git mergetool' command
[merge]
tool = vimdiff
[diff]
noprefix = true