-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitconfig
84 lines (65 loc) · 2.45 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
[git]
name = Anas Rchid
email = [email protected]
[user]
name = Anas Rchid
email = [email protected]
[alias]
a = add
ap = add -p
au = add -u
ac = !git add . && git commit -a -m
acu = !git add -u && git commit -a -m
c = commit --verbose
ca = commit -a --verbose
cm = commit -m
cam = commit -a -m
m = commit --amend --verbose
d = diff
ds = diff --stat -r
dch = diff --name-status -r
dca = diff --cached
s = status -s
st = status
co = checkout
cob = checkout -b
# Clone
cl = clone
# Use with caution
undo = reset --hard
# push all
pushitgood = !echo 'Ah, push it..\n' && git push -u origin --all && echo '\nP-push it real good'
# delete merged branch
cleanmerged = !git branch --merged | grep -v \"\\*\" | xargs -n 1 git branch -d
## Logs ##
##########
# one-line log
l = log --pretty=format:"%C(red)%h\\ %ad%C(yellow)%d\\ %Creset%s" --decorate --date=short
ll = log --pretty=format:"%C(red)%h\\ %ad%C(yellow)%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=short
hist = log --graph --pretty=format:'%Cred%h%Creset\t - %s %C(yellow)%d%Creset' --abbrev-commit --date=relative
histt = log --graph --pretty=format:'%Cred%h%Creset\t - %s %Cgreen(%cr) %C(yellow)%d%Creset' --abbrev-commit --date=relative
hista = log --graph --pretty=format:'%Cred%h%Creset\t - %s %Cgreen(%cr) %C(bold blue)<%an>%Creset %C(yellow)%d%Creset' --abbrev-commit --date=relative
tree = log --oneline --decorate --graph --stat --summary
fine = log --decorate --pretty=format:'(%C(yellow)%h %Creset -> %C(blue) %p%Creset) %Cgreen%cr%Creset %n %C(white)\"%s\"%Creset%n' --graph --topo-order
last = !sh -c 'git log $1@{1}..$1@{0} "$@"'
whois = "!sh -c 'git log -i -1 --pretty=\"format:%an <%ae>\n\" --author=\"$1\"' -"
whatis = show -s --pretty='tformat:%h (%s, %ad)' --date=short
# list branches sorted by last modified
bb = "!git for-each-ref --sort='-authordate' --format='%(authordate)%09%(objectname:short)%09%(refname)' refs/heads | sed -e 's-refs/heads/--'"
# list aliases
la = "!git config -l | grep alias | cut -c 7-"
deleted = log --diff-filter=D --summary
whatadded = log --diff-filter=A --summary
[cola]
tabwidth = 4
linebreak = false
boldheaders = true
spellcheck = false
[gui]
editor = emacsclient -c
[diff]
tool = meld
[merge]
tool = meld
[github]
user = Anas Rchid