-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitconfig
116 lines (96 loc) · 2.93 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
# @Author: adriamoya
# @Date: 2019-01-11T16:33:13+00:00
# @Last modified by: adriamoya
# @Last modified time: 2019-01-11T16:34:01+00:00
[user]
name = adriamoya
email = [email protected]
[github]
user = adriamoya
[alias]
# Staging
a = add
aa = add --all
# Branch
br = branch
branch-name = rev-parse --abbrev-ref HEAD
branch-diff = diff master...HEAD
branch-files = "!git diff master...HEAD --name-status | sed '/^D/d ; s/^.\\s\\+//'"
# Commit
c = commit
ca = commit -a
cm = commit -m
cal = !git add -A && git commit # Commit all changes
cam = commit -am
cne = commit --no-edit
amend = commit --amend
amend-all = !git add --all && git commit --amend --reuse-message=HEAD
# Clone
cl = clone
sclone = clone --depth=1
# Checkout
co = checkout
cb = checkout -b
# Cherry-pick
cp = cherry-pick
# Diff
d = diff --color-words
dc = diff --cached
df = !"git diff-index --quiet HEAD -- || clear; git --no-pager diff --patch-with-stat"
# Merge
m = merge
# Pull
up = pull
plom = pull origin master
plum = pull upstream master
preb = !git fetch upstream && git rebase upstream/master
# Push
p = push
pom = push origin master
poh = push origin head
# Stash
st = stash
stp = stash pop
# Status/Logging
s = status -s -b
hist = log --graph --pretty=custom # Show custom graph
l = log --pretty=custom # Show custom log
ll = log --stat --abbrev-commit
lc = shortlog --summary --numbered # List contributors
#lg = log --oneline --decorate --all --graph
lg = log --graph --pretty='%C(yellow)%h%Creset %C(auto)%d%Creset %s %C(bold blue)<%an>%Creset %Cgreen%ad (%cr)' --all --date=format:'%Y-%m-%d %H:%M'
# Reset
unstage = reset HEAD -- # Mixed reset (affects HEAD and Index)
undo = reset --soft HEAD~1 # Undo last commit (affects HEAD only)
reset = reset --hard HEAD~1 # Remove last commit (from HEAD, Index and Working Dir)
# Remote
r = remote -v
# Submodules
subpl = submodule update --init --recursive
# Git flow
new = !git pull origin develop && git flow feature start
done = !git pull origin develop && git flow feature finish "$(git symbolic-ref --short HEAD | sed -n 's/^feature\\///p')"
go = !git checkout $1 && pull
master = !git checkout master && pull
develop = !git checkout develop && pull
mmm = !git fetch origin master && git rebase origin/master
ddd = !git fetch origin develop && git rebase origin/develop
# Misc
publish = "!git push --set-upstream origin $(git branch-name)"
[core]
excludesfile = ~/.gitignore_global
editor = nano
filemode = false
trustctime = false
autocrlf = input
pager = diff-so-fancy | less --tabs=4 -RFX
[color]
ui = true
[diff]
tool = vscode
[difftool "vscode"]
cmd = code --wait --diff $LOCAL $REMOTE
[merge]
tool = vscode
[mergetool "vscode"]
cmd = code --wait $MERGED