-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.gitconfig
71 lines (55 loc) · 1.7 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
[user]
name = Dan Carley
email = dan.carley@gmail.com
[core]
excludesfile = ~/.gitignore
[color]
# Use nice syntax highlighting everywhere.
ui = true
[pull]
ff = only
[rebase]
autosquash = true
abbreviateCommands = true
[merge]
tool = vimdiff
[mergetool]
prompt = false
[interactive]
singlekey = true
[alias]
# Alias some shorthand commands like SVN.
st = status
di = diff
ci = commit --verbose
br = branch
co = checkout
rh = reset HEAD
short = rev-parse --short
# push/pull only the current branch.
# Serves "push.default = tracking" behaviour for <1.6.3 clients.
# Ref: http://stackoverflow.com/a/2444495
bpush = "!f() { git push --set-upstream ${1:-origin} $(git symbolic-ref HEAD); }; f"
bpull = "!f() { git pull ${1:-origin} $(git symbolic-ref HEAD); }; f"
fpush = "push --force-with-lease"
# Force `stash pop` on a dirty tree.
# Ref: http://stackoverflow.com/a/3733698
fpop = "!f() { git stash show -p | git apply && git stash drop; }; f"
# Edit unmerged files that have merge conflicts.
resolve = "!f() { git diff --name-only --diff-filter=U; }; vim $(f)"
# Delete merged branches.
brc = "!f() { \
git branch --merged master |\
grep -v '^[ *] master$' |\
xargs git branch --delete; \
}; f"
# Grab a pull request as a local branch.
pr = "!f() { \
[ $# -eq "1" ] && REMOTE=origin PR=$1 || REMOTE=$1 PR=$2; \
git fetch ${REMOTE} refs/pull/${PR}/head:pr/${PR} && git checkout pr/${PR}; \
}; f"
[push]
# Push the local/tracking branch, rather than everything.
default = tracking
[url "git@github.com:"]
insteadOf = https://github.com/