-
Notifications
You must be signed in to change notification settings - Fork 2
/
dot_gitconfig
85 lines (58 loc) · 1.54 KB
/
dot_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
[init]
defaultBranch = main
[user]
editor = nvim
[apply]
whitespace = strip
[diff]
color = auto
[color]
ui = auto
[core]
quotepath = false
[merge]
tool = vimdiff
[mergetool "vimdiff"]
cmd = nvim -d $BASE $LOCAL $REMOTE $MERGED -c '$wincmd w' -c 'wincmd J'
# only for git ~> 1.8
[push]
default = simple
[alias]
s = status --short --branch
d = diff
dc = diff --cached
br = branch
c = commit
amend = commit --amend
cp = cherry-pick
a = add
aa = !git add --all && git status -s --branch
intent = add --all --intent-to-add
sum = add --patch
co = checkout
cob = checkout -b
rb = rebase
who = shortlog -n -s --no-merges
up = pull --rebase
l = log --graph --pretty=format:'%C(auto)%h%d%Creset | %Cgreen%an%Creset | %s | %Cblue%cr%Creset'
bname = rev-parse --abbrev-ref HEAD # branch name
publish = !git push -u origin $(git bname)
draft = stash save -u
# exclude: http://coderwall.com/p/n1d-na
exclude = !sh -c 'mkdir -p .git/info && echo "$1" >> .git/info/exclude' -
ex = !git exclude
ignore = !sh -c 'echo "$1" >> .gitignore' -
# select a branch from a menu thanks to scout.
select = !git branch | cut -c 3- | scout -i | xargs git checkout
sl = !git select
# force push with care
shift = push --force-with-lease
# remove .orig files
rmorig = !git status --short | cut -c 4- | grep -e "\\.orig$" | xargs rm
# rename current branch
rename = br -m
[include]
path = .gitconfiglocal.inc
[rerere]
enabled = true
# vim:set ft=gitconfig: