-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitconfig
139 lines (130 loc) · 5.04 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
[user]
name = Hector Rivas Gandara
email = [email protected]
[alias]
a = add
c = clone
t = tag
au = add -u .
ap = add -p
br = branch -v
bl = blame
cl = clean
clf = clean --force
sh = show
sb = show-branch
ds = diff --stat
ls = ls-files
lo = log
st = status
co = checkout
cp = cherry-pick
ci = commit -v
df = diff
rb = rebase
rbc = rebase --continue
rbs = rebase --skip
rbi = rebase --interactive
me = merge
rs = remote show
sb = show-branch
pu = pull
pur = pull --rebase --autostash
pus = submodule foreach git pull origin master
purs = pull --recurse-submodules
pt = push --tags
w = whatchanged
dfs = diff --staged
sts = status -s
rl = reflog
ref = reflog
rst = reset
rt = remote
sm = submodule
sms = submodule status
smi = submodule init
smu = submodule update
smf = submodule foreach
rup = remote update
rpr = remote prune
cia = commit -v -a
com = checkout master
detach = checkout HEAD^0
info = config --list
summary = log --oneline
rank = shortlog -sn --no-merges
tree = log --graph --oneline --decorate
pom = push origin master
pob = !sh -c 'git push origin $(git branch -l 2> /dev/null | sed -e \"/^[^*]/d\" -e \"s/* \\(.*\\)/\\1/\")'
# Push origin force curreny branch
pof = !sh -c 'git push --force-with-lease origin $(git rev-parse --abbrev-ref HEAD)'
amend = commit --amend
last = log --oneline -10
review = log --stat=160,180 -p -w --patience --reverse -M -C -C -c
undo = reset --hard
lg1 = log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all
lg2 = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all
lg = !"git lg1"
# From http://blogs.atlassian.com/2014/10/advanced-git-aliases/
# Show commits since last pull
new = log HEAD@{1}..HEAD@{0}
# Add uncommitted and unstaged changes to the last commit
caa = commit -a --amend -C HEAD
pickaxe = log -p -S
# Remove merged branches or branches not in the remote
clean-branches = !"git fetch -p && git branch --merged | grep -v '\\*' | xargs -n 1 git branch -D && git remote | xargs -n1 git remote prune"
# List branches ordered by date
ls-branch = !git-ls-branch
# Pick a branch from a list of branches with the interactive tool peco
peco = !"git ls-branch | peco | head -n1 | awk '{print $4}' | sed 's/\\x1b\\[[0-9;]*m//g' | xargs -n1 git checkout"
# show current hash
hash = log --pretty=format:'%h %H' -n 1
# Fixup the changes of a given file with the latest commit that changed it
# Trick for positional args: https://stackoverflow.com/a/3322412/395686
fixupfile = "!f() { git commit --fixup=$(git log --full-history -1 --format=format:%h -- \"$1\") \"$@\";}; f"
# Select the commit to fixup compared to master
pecofix = !"git commit --fixup $(git log --oneline master..HEAD | peco | head -n1 | awk '{print $1}')"
# duet-rebase: Rebase reseting commiters with duet
duet-rebase = rebase --exec 'git duet-commit --amend --reset-author --no-edit'
# duet-rebase-rotate: Rebase reseting commiters with duet
duet-rebase-rotate = rebase --exec 'GIT_DUET_ROTATE_AUTHOR=1 git duet-commit --amend --reset-author --no-edit'
# Clone github PR code
pr = "!f() { git fetch origin pull/$1/head:pr-$1 && git checkout pr-$1; }; f"
# pull master and rebase current branch
mpur = !"git fetch origin && git branch -f master origin/master && git rebase -p master --autostash"
whatever = !"git branch --set-upstream-to=origin/$(git rev-parse --abbrev-ref HEAD) $(git rev-parse --abbrev-ref HEAD)"
[color]
branch = auto
diff = auto
status = auto
interactive = auto
ui = true
pager = true
[pack]
threads = 0
[rename]
limit = 0
[merge]
log = true
[core]
pager = less -FRSX
excludesfile = ~/.global_gitignore
[push]
default = current
[giggle]
main-window-maximized = true
main-window-view = HistoryView
[init]
templatedir = ~/.git-templates
[color "diff"]
whitespace = red reverse
[http]
cookiefile = /Users/keymon/.gitcookies
[rebase]
autosquash = true
[include]
path = ~/.gitconfig.local
[diff]
wsErrorHighlight = all
[url "ssh://[email protected]/"]
insteadOf = https://github.com/