forked from whiteinge/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitconfig
More file actions
104 lines (84 loc) · 3.16 KB
/
.gitconfig
File metadata and controls
104 lines (84 loc) · 3.16 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
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
[user]
name = Seth House
[alias]
b = branch -vv
bc = branch --contains
cdate = "!git --no-pager log -1 --format='%ci'"
ci = commit
co = checkout
d = diff
dc = diff --cached
f = fetch --all
m = merge --no-ff
r = rebase
re = reset --hard @{upstream}
short = rev-parse --short
st = status -s -b
up = merge --ff-only @{upstream}
rl = reflog --date=relative
stat = diff --stat
# Perform a merge in-memory and output if any conflicts are found (dry-run)
# Takes the name of a branch / ref to merge
mergetest = "!sh -c 'git merge-tree `git merge-base $1 HEAD` $1 HEAD \
| awk '\\''/^@@/ { print \"Conflicts found\"; exit 1 }'\\''' -"
l = log --oneline --decorate
ll = log --stat --decorate --abbrev-commit --date=relative
lll = log -p --stat --decorate --abbrev-commit --date=relative
llll = "!sh -c 'git lll $@ \
| gvim - -R -v -c \"set ft=git\" -c \"set fdm=syntax\"' -"
# http://tbaggery.com/2011/08/08/effortless-ctags-with-git.html
ctags = !.git/hooks/ctags
# Open all modified files in EDITOR
editm = "!$EDITOR $(git ls-files -m)"
# Alias to make an archive with a prefix set to the name of the repo.
# git tar <ref> (defaults HEAD)
tar = "!bash -c 'REF=${1:-HEAD}; \
BASE=$(basename $(git rev-parse --show-toplevel)); \
git archive --prefix=${BASE}/ -o ${BASE}-$(git describe ${REF}).tar.gz ${REF}' -"
# Show the correct SHA for merging from FETCH_HEADS
showfetchhead = "!awk '!/not-for-merge/ {print $1}' \
$(git rev-parse --git-dir)/FETCH_HEAD"
# Compare local branches to remote branches (without doing a fetch!)
# Takes (optional) remote name as an argument; default: "upstream".
# FIXME: branches that are ahead of upstream will also be shown.
showstale = "!bash -c 'join -j 2 \
<(git show-ref --heads) \
<(git ls-remote --heads ${1:-upstream}) \
| awk '\\''{ if ($2 != $3) print $1 }'\\''' -"
### Custom Git commands (found in ~/bin)
# Push only the current branch to the upstream branch
p = pushcurrent
# Show individual diffs for all incoming/outgoing changesets
in = pagediffs ..@{u}
out = pagediffs @{u}..
# Configure local clone to also make local refs for all GitHub pull
# requests for the specified remote
# Usage: git addrefspr upstream; git fetch upstream; git show upstream/pr/13
addrefspr = "!sh -c 'git config --add \
remote.$1.fetch \"+refs/pull/*/head:refs/remotes/$1/pr/*\"' -"
[core]
excludesfile = ~/.gitignore
[color]
ui = auto
[init]
templatedir = ~/.git_template
[sendemail]
smtpencryption = tls
smtpserver = smtp.gmail.com
smtpuser = [email protected]
smtpserverport = 587
[diff]
tool = clivimdiff
[difftool "clivimdiff"]
cmd = gvimdiff -v $LOCAL $REMOTE
[merge]
tool = diffconflicts
[mergetool "diffconflicts"]
cmd = diffconflicts $EDITOR $BASE $LOCAL $REMOTE $MERGED
trustExitCode = true
keepBackup = false
[mergetool "gdiffconflicts"]
cmd = diffconflicts gvim $BASE $LOCAL $REMOTE $MERGED
trustExitCode = true
keepBackup = false