-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitconfig
86 lines (76 loc) · 2.88 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
[core]
attributesFile = ~/.gitattributes
autocrlf = input
editor = vim
excludesfile = ~/.gitignore_global
ignorecase = false
pager = less -R
precomposeunicode = true
preloadindex = true
[init]
defaultBranch = main
[pull]
ff = only
rebase = false
[push]
default = current
[color]
ui = auto
interactive = auto
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "diff"]
meta = yellow bold
frag = magenta bold
old = red bold
new = green bold
[merge]
ff = false
[alias]
# Daily basics shortcuts
a = add
br = branch -v
c = clone --recursive
ca = !git add -A && git commit -av
ci = commit -v
df = diff --color
co = checkout
fp = fetch --all --prune
lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%C(bold blue)<%an>%Creset' --abbrev-commit
ll = log --stat
ls = log --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
go = "!f() { git switch -c \"$1\" 2>/dev/null || git switch \"$1\"; }; f"
pu = pull --rebase --stat
rb = rebase -i
rt = restore
rup = remote update --prune
st = status --branch --short --untracked-files=normal
up = push -u origin HEAD
vdf = difftool -t vimdiff -y
# Other utilities
amend = !git log -n 1 --pretty=tformat:%s%n%n%b | git commit -F - --amend
branches = branch -a
brclean = !git branch --merged | grep -v \"\\*\" | xargs -n 1 git branch -d
changed = !git diff --stat $(git merge-base --fork-point $(git symbolic-ref refs/remotes/origin/HEAD | sed \"s@^refs/remotes/origin/@@\") HEAD)
changed-ls = !git diff --name-only $(git merge-base --fork-point $(git symbolic-ref refs/remotes/origin/HEAD | sed \"s@^refs/remotes/origin/@@\") HEAD)
churn = "!f() { git log --format=format: --name-only --since=${1:-12.month} | egrep -v \"^$\" | sort | uniq -c | sort -nr | head -${2:-50}; }; f"
coprev = !git checkout HEAD^
conext = !git checkout `git log --reverse --ancestry-path HEAD..master | head -n 1 | cut -d ' ' -f 2`
cohead = !git checkout `git log --branches -1 --pretty=format:'%D' |cut -d ',' -f 2`
coinit = !git checkout `git log --oneline|tail -n1 |cut -d ' ' -f 1`
ignored = !git status --ignored -s | grep '!!' | cut -d' ' -f2
last = log --abbrev-commit -1 HEAD
pushf = push --force-with-lease
remotes = remote -v
tags = tag -l
top = shortlog -nsw -e
unpushed = log --branches --not --remotes --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
unstage = restore --staged
vommit = commit
wip = for-each-ref --sort='authordate:iso8601' --format=' %(color:green)%(authordate:relative)%09%(color:white)%(refname:short)' refs/heads
who = !git config -l --name-only | grep -E 'user.+' | xargs -n1 git config --get
# include additional custom configuration for git users and/or organizations
[include]
path = ~/.dotfiles/._system/custom/.gitconfig