-
Notifications
You must be signed in to change notification settings - Fork 1
/
gitconfig
72 lines (63 loc) · 4.2 KB
/
gitconfig
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
65
66
67
68
69
70
71
72
[user]
name = Lee Netherton
useConfigOnly = true
[color]
diff = auto
status = auto
branch = auto
interactive = auto
ui = true
pager = true
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "diff"]
meta = yellow bold
frag = magenta bold
old = red bold
new = green bold
[color "status"]
added = yellow
changed = green
untracked = cyan
[core]
pager = less -FRSX
whitespace=fix,-indent-with-non-tab,trailing-space,cr-at-eol
[alias]
fetch-new = "!f() { if [ $(( $(date +%s) - $(stat -c %Y .git/FETCH_HEAD) )) -gt 1200 ]; then echo 'Fetching new commits...'; git fetch; fi }; f" # Only fetch every 20 mins
co = checkout
lg = log --graph --date=format:'%Y-%m-%d %H:%M' --pretty=format:\"%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%cr - %ad) %C(bold blue)<%an, %ae>%Creset\" --abbrev-commit
tg = log --no-walk --tags --date=format:'%Y-%m-%d %H:%M' --pretty=format:\"%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%cr - %ad) %C(bold blue)<%an, %ae>%Creset\" --abbrev-commit
rl = reflog --pretty=format:\"%Cred%h%Creset %C(auto)%gd%Creset %C(auto)%gs%C(reset) %C(green)(%cr)%C(reset) %C(bold blue)<%an>%Creset\" --abbrev-commit
sl = stash list --pretty=format:\"%C(red)%h%C(reset) - %C(dim yellow)(%C(bold magenta)%gd%C(dim yellow))%C(reset) %<(70,trunc)%s %C(green)(%cr) %C(bold blue)<%an>%C(reset)\" --abbrev-commit
tags = !git fetch-new && git tag -l --format='%(taggerdate:short) -> %(tag)' --sort=taggerdate && :
catchup = "!f(){ echo -n \"reset \\033[0;33m$(git symbolic-ref -q --short HEAD)\\033[0m to \\033[0;33m$(git for-each-ref --format='%(upstream:short)' $(git symbolic-ref -q HEAD))\\033[0m? (Y/n) \"; read -r ans; if [ \"$ans\" = \"y\" -o \"$ans\" = \"Y\" -o -z \"$ans\" ]; then git fetch; git reset --hard $(git for-each-ref --format='%(upstream:short)' $(git symbolic-ref -q HEAD)); else echo \"catchup aborted\"; fi }; f"
stat = status --untracked-files=no
rb = !git pull && git rebase origin/develop && git push -f && :
b = !git fetch-new && git checkout -b feature/LN/$1 origin/develop --no-track && :
diff-commit = "!f() { git difftool -d $1^..$1; }; f"
diff-common-ancestor = "!f() { base=$1; if [ $base == "" ]; then base=origin/develop; fi; git fetch-new; git difftool -d $(git merge-base HEAD $base); }; f"
diff-size-common-ancestor= "!f() { base=$1; if [ $base == "" ]; then base=origin/develop; fi; git fetch-new; curl -s https://gist.githubusercontent.com/cschell/9386715/raw/43996adb0f785a5afc17358be7a43ff7ee973215/git-file-size-diff | bash -s $(git merge-base HEAD $base)..HEAD; }; f"
diff-size = "!f() { curl -s https://gist.githubusercontent.com/cschell/9386715/raw/43996adb0f785a5afc17358be7a43ff7ee973215/git-file-size-diff | bash -s $1; }; f"
large-files = "!git rev-list --objects --all | git cat-file --batch-check='%(objecttype) %(objectname) %(objectsize) %(rest)' | sed -n 's/^blob //p' | sort --numeric-sort --key=2 | cut -c 1-12,41- | numfmt --field=2 --to=iec-i --suffix=B --padding=7 --round=nearest | tail -n100"
branch-status = "!git for-each-ref --format=\"%(refname:short) %(upstream:short)\" refs/heads | while read local remote; do remote=origin/develop; git rev-list --left-right ${local}...${remote} -- 2>/dev/null >/tmp/git_upstream_status_delta || continue; LEFT_AHEAD=$(grep -c '^<' /tmp/git_upstream_status_delta); RIGHT_AHEAD=$(grep -c '^>' /tmp/git_upstream_status_delta); echo \"$local (ahead $LEFT_AHEAD) | (behind $RIGHT_AHEAD) $remote\"; done"
branch-clean = "!f() { git fetch --prune; git branch --merged | egrep -v \"(^\\*|master|develop)\" | xargs git branch -d 2>/dev/null; git remote prune origin; }; f"
[giggle]
compact-mode = false
main-window-maximized = true
main-window-geometry = 0x0+0+0
[push]
default = simple
[diff]
tool = meld
[merge]
tool = meld
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
required = true
process = git-lfs filter-process
[credential]
helper = !aws codecommit credential-helper $@
UseHttpPath = true