-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgitconfig
More file actions
69 lines (60 loc) · 1.64 KB
/
Copy pathgitconfig
File metadata and controls
69 lines (60 loc) · 1.64 KB
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
[user]
email = hannes@jumpstarter.io
name = Hannes Landeholm
[core]
editor = "nano"
excludesfile = /home/hannes/.gitignore_global
[push]
default = current
[pager]
diff = diff-highlight | less
log = diff-highlight | less
show = diff-highlight | less
[advice]
pushNonFastForward = false
statusHints = false
commitBeforeMerge = false
resolveConflict = true
implicitIdentity = false
detachedHead = false
[alias]
# Logic:
#
# The 'git stash save' fails if the tree is clean (instead of
# creating an empty stash :P). So, we only 'stash' and 'pop' if
# the tree is dirty.
#
# The 'git rebase --whitespace=fix HEAD~' throws away the commit
# if it's empty, and adding '--keep-empty' prevents the whitespace
# from being fixed. So, we first check that the index is dirty.
#
# Also:
# - '(! git diff-index --quiet --cached HEAD)' is true (zero) if
# the index is dirty
# - '(! git diff-files --quiet .)' is true if the tree is dirty
#
# The 'rebase --whitespace=fix' trick is from here:
# http://stackoverflow.com/a/19156679/470844
fixws = !"\
if (! git diff-files --quiet .) && \
(! git diff-index --quiet --cached HEAD) ; then \
git commit -m FIXWS_SAVE_INDEX && \
git stash save FIXWS_SAVE_TREE && \
git rebase --whitespace=fix HEAD~ && \
git reset --soft HEAD~ && \
git stash pop ; \
elif (! git diff-index --quiet --cached HEAD) ; then \
git commit -m FIXWS_SAVE_INDEX && \
git rebase --whitespace=fix HEAD~ && \
git reset --soft HEAD~ ; \
fi"
# Commit verbose.
c = "commit -v"
# Status.
s = "status"
# Add (with patch).
a = "add -p"
# Diff.
d = "diff"
# Cached diff.
cd = "diff --cached"