-
Notifications
You must be signed in to change notification settings - Fork 9
/
gitconfig
86 lines (77 loc) · 2.69 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
[user]
name =
email =
[github]
user =
token =
[color]
ui = true
[alias]
st = status -sb
ci = commit
co = checkout
br = branch
cp = cherry-pick
up = pull --rebase
ff = pull --ff-only
lg = log --decorate
logs = log --stat --decorate
logg = log --graph --decorate --branches --remotes
pop = stash pop
override = !sh -c 'echo git add -- $0 && echo git reset HEAD -q -- $0 && echo git checkout -- $0'
wu = log --stat origin..@{0}
unadd = rm --cached
sup = !git stash && git up && git pop
sff = !git stash && git ff && git pop
# force stash pop to apply, even if there are uncommitted changes
popf = !git stash show -p | git apply && git stash drop
applyf = !git stash show -p | git apply
# check if a branch has been merged into the current HEAD
merged = !sh -c 'git rev-list HEAD | grep $(git rev-parse $0)'
# git svn aliases
#spull = !git svn fetch && git svn rebase -l
srebase = !git stash && git svn rebase -l && git stash pop
sdcommit = !git stash && git svn dcommit && git stash pop
# move the last commit to a new branch
rebranch = !sh -c 'git stash && git branch $0 && git reset --hard HEAD^ && git checkout $0'
# update commit timestamp on last commit
update-timestamp = commit --amend --reset-author --no-edit
purge-remote = !sh -c 'echo git branch -a | echo sed -n \"/master$/d;s?^ *remotes/$0/??p\"'
exec = "!exec "
root = rev-parse --show-toplevel
current-branch = rev-parse --abbrev-ref HEAD
recent-branches = branch --sort=-committerdate
co-recent = !git branch --sort=-committerdate | fzf +s | xargs -r git checkout
# diff-highlight
diffh = !sh -c 'git diff --color | diff-highlight'
diffhf = !sh -c 'git diff --color | diff-highlight | diff-so-fancy'
gone = ! "git fetch --all -p && git for-each-ref --format '%(refname:short) %(upstream:track)' | awk '$2 == \"[gone]\" {print $1}'"
gone-rm = ! "git fetch --all -p && git for-each-ref --format '%(refname:short) %(upstream:track)' | awk '$2 == \"[gone]\" {print $1}' | xargs -r git branch -D"
[mergetool "mvimdiff"]
cmd = mvimdiff \"$LOCAL\" \"$REMOTE\" \"$MERGED\" \"$BASE\"
[mergetool "p4merge"]
cmd = p4merge "$BASE" "$LOCAL" "$REMOTE" "$MERGED"
trustExitCode = false
[mergetool]
keepBackup = false
[merge]
tool = p4merge
conflictstyle = diff3
[push]
default = current
[core]
excludesfile = $HOME/.gitignore
# New in Git 2.8.0
# https://git-scm.com/docs/git-update-index#_untracked_cache
# Test with:
# git update-index --test-untracked-cache
untrackedCache = true
[diff]
compactionHeuristic = true
renameLimit = 1000
[pager]
log = diff-highlight | less
show = diff-highlight | less
diff = diff-highlight | less
[interactive]
diffFilter = diff-highlight