-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitconfig
66 lines (65 loc) · 2.83 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
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
[user]
name = Itai Noam
email = [email protected]
[core]
editor = nvim
excludesfile = /Users/itai/.gitignore
# pager = /usr/local/Cellar/git/2.27.0/share/git-core/contrib/diff-highlight/diff-highlight | less
fileMode = false
[alias]
lg = !git --no-pager log --pretty=format:'%h %<(20)%an %<(15)%cr %s %C(yellow)%d%Creset' --decorate-refs="*develop*" -20
llg = !git --no-pager log --pretty=format:'%h %<(20)%an %<(15)%cr %s'
lg-file = !git lg --follow
a = add
recent = !git for-each-ref --sort=-committerdate --format='%(refname:short)' refs/heads/ | head -n 100
c = commit
d = diff --ignore-space-change
f = fetch
o = checkout
co = checkout
cob = checkout -b
s = status
w = whatchanged
aliases = "!git config -l | grep alias | cut -c 7-"
ca = commit --amend
wip = "!git commit --no-verify -am 'wip' > /dev/null && if [ $(git log -1 --pretty=%B | grep -c wip) == 1 ]; then echo 'added wip commit' ;fi"
unwip = "!if [ $(git log -1 --pretty=%B | grep -c wip) == 1 ]; then git uncommit; echo 'removed wip commit' ;fi"
reset-to-origin = reset --hard @{upstream}
switch = !git checkout $(git branch --sort=-committerdate | fzf --height 40% --reverse)
switch-r = !git checkout --track $(git branch -r --sort=-committerdate | head -n20 | fzf --height 40% --reverse)
start = !"f() { git fetch && git checkout master && git rebase --autostash && git checkout -b "itai/$1" master; }; f"
extend= !git commit --amend --no-edit
reword= !git commit -o --no-verify --amend
fixup = !sh -c '[ -z "$1" ] && git commit --fixup=$0 && git rebase --interactive --autosquash $0~'
fix-pr= !git extend && git push-f
uncommit = reset --soft HEAD~1
update-pr = !git pull --rebase && git push-f
push-f = push --force-with-lease
branches = !git branch --sort=-committerdate | fzf --height 40% --reverse
commits = "!HASH=`git --no-pager log --pretty=format:'%h %<(20)%an %<(15)%cr %s' | fzf --height 60% --tiebreak=index --reverse | awk 'END { if (NR==0) exit 1; else print $1;}'` && echo $HASH"
commits-diverged= "!BRANCH=`git rev-parse --abbrev-ref HEAD` && echo '\n*** commits only in remote ***' && git lg HEAD..origin/${BRANCH} && echo '\n*** commits only in local ***' && git lg origin/${BRANCH}..HEAD"
whats-up="!git branch -r --sort=-committerdate --format '%(creatordate:relative);%(committername);%(refname:lstrip=-2)' | column -s ';' -t | head -n 10"
pushf = push --force-with-lease
[push]
default = current
[github]
user = itainoam
[commit]
verbose = true
[rebase]
autosquash = true
[hub]
host = git.autodesk.com
[pager]
diff = diff-highlight | less
[branch]
sort = -committerdate
[diff]
tool = vimdiff
[pull]
rebase = true