-
Notifications
You must be signed in to change notification settings - Fork 0
/
gitconfig
74 lines (66 loc) · 2.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
[color]
ui = true
[push]
default = simple
[alias]
# Common Shorthands
# -----------------
a = add
c = commit
ca = commit --amend
co = checkout
cod = !sh -c 'git checkout $(git default)'
cp = cherry-pick
cpc = cherry-pick --continue
d = diff
lg = log --format=\"%w(92,0,21)%C(yellow)%h %Cgreen%<(12)%an %Creset%s\" --graph
mv = branch --move
pl = pull
ps = push
rb = rebase
rbc = rebase --continue
st = status -sb
helper = osxkeychain
# Workflow Macros
# ---------------
# If you see the following ERROR message:
# fatal: ref refs/remotes/origin/HEAD is not a symbolic ref
#
# Run the following command:
# (replace "master" with your default branch name if it is different)
# echo "ref: refs/remotes/origin/master" > .git/refs/remotes/origin/HEAD
# print name of default branch (typically develop or master)
default = !sh -c 'git symbolic-ref refs/remotes/origin/HEAD | sed "s@^refs/remotes/origin/@@"' -
# fetch-origin-merge-origin: update feature branch with latest changes from default branch
fomo = !sh -c '\
BRANCH=${1:-$(git default)} && \
echo "Merging latest $BRANCH..." && \
git fetch origin $BRANCH && \
git merge --no-ff FETCH_HEAD' -
# start a feature branch
start = checkout -b
# finish a feature branch: delete it, checkout default, pull latest
finish = !sh -c '\
CURRENT=$(git rev-parse --abbrev-ref HEAD) && \
BRANCH=${1:-$(git default)} && \
echo "Finishing feature branch $CURRENT into $BRANCH..." && \
git checkout $BRANCH && \
git branch -D $CURRENT && git pull' -
# "squash last 4 commits" = g sq 4
sq = !sh -c 'git rebase -i HEAD~$0'
# diff-so-fancy: better console colors
# https://github.com/so-fancy/diff-so-fancy
[core]
pager = diff-so-fancy | less --tabs=4 -RFX
[color "diff-highlight"]
newHighlight = green bold 22
newNormal = green bold
oldHighlight = red bold 52
oldNormal = red bold
[color "diff"]
commit = 227 bold
frag = magenta bold
meta = 227
new = green bold
old = red bold
whitespace = red reverse