-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgitconfig
95 lines (79 loc) · 3.57 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
[merge]
tool = opendiff
[core]
excludesfile = ~/.gitignore_global
editor = nvim
[alias]
st = status -sb
ci = commit
co = checkout
br = branch
sb = show-branch
dt = difftool
pu = push
pf = push --force-with-lease
cia = commit -a --amend
cian = commit -a --amend --no-edit
r = remote
branch-name = !git for-each-ref --format='%(refname:short)' `git symbolic-ref HEAD`
desc = !git config branch.`git branch-name`.description
# log variations
hist = log --pretty=format:\"%h %Cgreen%ad%Creset %s%d [%an]\" --graph --decorate --date=short
histc = log --pretty=format:'%h %ad %s%x09%ae' --date=short
hi = !git hist --since=1.week.ago
h = !git hi
week = !git hi
today = !git hist --since=1.day.ago
last = !git --no-pager hi -n1
lol = log --graph --decorate --oneline
lola = log --graph --decorate --oneline --all
notify = log --pretty=oneline --abbrev-commit -n 1 --no-color
tree = log --oneline --decorate --graph
# short logs
h1 = !git hi -1
h2 = !git hi -2
h3 = !git hi -3
h4 = !git hi -4
h5 = !git hi -5
l1 = log --pretty=oneline
ls = !git hi --stat
lg = log --graph
cp = cherry-pick
aa = add --all :/
# since master
sm = !git hist master..
smo = !git hist origin/master..
# tags sorted by date
t = for-each-ref --sort='*authordate' --format='%(tag)' refs/tags
# deleted files
deleted = !git hist --diff-filter=D --summary
root = !pwd
tracks = !sh -c 'git rev-parse --verify "${1:-HEAD}@{upstream}" 2> /dev/null'
# vimdiff = "difftool -y -t mvimdiff"
# Find FIXME, TODO, etc
n = !"git ls-files | xargs notes | awk -F: '{ print $1,$2; print $3,$4; print $5}' | grcat conf.notes "
latest=describe --abbrev=0 --tags
lt=!git latest # latest tag
# Fetching
f = fetch
fp = fetch --prune
g = grep --break --heading --line-number
dsf = "!f() { [ -z \"$GIT_PREFIX\" ] || cd \"$GIT_PREFIX\" && git diff --color \"$@\" | diff-so-fancy | less --tabs=4 -RFX; }; f"
# from https://docs.gitlab.com/ee/user/project/merge_requests/reviewing_and_managing_merge_requests.html#copy-the-branch-name-for-local-checkout
mr = !sh -c 'git fetch $1 merge-requests/$2/head:mr-$1-$2 && git checkout mr-$1-$2' - slm = !echo $(git log --author=\"$(git config user.name)\" --no-merges --before=$(date \"+%Y-%m-01T00:00\") --after=$(date -d \"-$(date +%d) days -1 month\" \"+%Y-%m-%dT23:59\") --reverse | grep commit | wc -l) commits, $(git log --author=\"$(git config user.name)\" --no-merges --before=$(date \"+%Y-%m-01T00:00\") --after=$(date -d \"-$(date +%d) days -1 month\" \"+%Y-%m-%dT23:59\") --reverse --stat | grep -Eo \"[0-9]{1,} files? changed\" | grep -Eo \"[0-9]{1,}\" | awk \"{ sum += \\$1 } END { print sum }\") files changed, $(git log --author=\"$(git config user.name)\" --no-merges --before=$(date \"+%Y-%m-01T00:00\") --after=$(date -d \"-$(date +%d) days -1 month\" \"+%Y-%m-%dT23:59\") --reverse --stat | grep -Eo \"[0-9]{1,} insertions?\" | grep -Eo \"[0-9]{1,}\" | awk \"{ sum += \\$1 } END { print sum }\") insertions and $(git log --author=\"$(git config user.name)\" --no-merges --before=$(date \"+%Y-%m-01T00:00\") --after=$(date -d \"-$(date +%d) days -1 month\" \"+%Y-%m-%dT23:59\") --reverse --stat | grep -Eo \"[0-9]{1,} deletions?\" | grep -Eo \"[0-9]{1,}\" | awk \"{ sum += \\$1 } END { print sum }\") deletions last month
[color]
ui = auto
[user]
name = Trevor Hartman
email = [email protected]
[difftool]
prompt = false
[push]
default = current
followTags = true
[grep]
lineNumber = true
[github]
user = devth
[ghi]
token = !security find-internet-password -a devth -s github.com -l 'ghi token' -w