-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path.gitconfig
More file actions
90 lines (75 loc) · 2.97 KB
/
.gitconfig
File metadata and controls
90 lines (75 loc) · 2.97 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
[core]
# Global .gitignore file
excludesfile = /Users/benkomalo/.gitignore_global
autocrlf = input
[user]
name = Ben Komalo
email = benkomalo@gmail.com
[color]
status = auto
branch = auto
diff = auto
interactive = auto
[branch]
# auto-adds the --track flag to git branch. Helps out arc (for Phabricator).
autosetupmerge = always
autosetuprebase = always
[alias]
graph = log --graph --decorate --oneline --pretty=format:"%h%x20%Cgreen%d%x20%Cred%an%x20%Cblue%ad%x20%Creset%s" --all --full-history --date=short
slog = log --oneline --pretty=format:"%h%x20%x20%Cred%an%x20%Cblue%ad%x20%Creset%s" --date=short
comit = commit
nothave = ls-files --exclude-standard --ignored --others
st = status --short --branch
br = "!f() { git branch -vv $* | git_branch_formatter.py; }; f"
df = diff
qdiff = diff --no-ext-diff
dd = difftool --dir-diff
snippets = !sh -c 'git log --no-merges --oneline --author=benkomalo --since=1.week' #`date -v-mon '+%Y/%m/%d'`'
nuke = !git reset --hard && git submodule update --recursive
sup = submodule update --recursive
ff = merge --ff-only
cane = commit -a --amend --no-edit
lpurge = "!f() { git remote prune origin | grep -o origin/benkomalo/.* | grep -o benkomalo/.* | xargs git branch -D; }; f"
# Set upstream and rebase
sur = "!f() { git branch --set-upstream-to=$1 && git upd; }; f"
upd = "!f() { git rebase --onto '@{u}' HEAD^ $(git symbolic-ref --short HEAD); }; f"
# Ignore whitespace changes
bw = blame -w
# Auto update submodules
co = "!f() { git checkout $* && git submodule update --init --recursive; }; f"
# Open a phabricator URL if available (note: xdg-open is for linux and
# open is OS-X). This just parses the commit message of the specified SHA
# for a phabricator URL. If no commit SHA is explicitly specified, this uses
# HEAD, and will also look backwards using `arc which` to see if any
# phabricator URLs can be found in the recent history according to `arc`.
phab = "!f() { \
url=`git log -n1 $1 | sed -n 's/^ *Differential Revision: *//p' `; \
if [ -z \"$url\" ] && [ -z \"$1\" ]; then \n\
diff=`arc which | grep -o '^ *D\\d*'`; \
url=`echo $diff | sed 's/^ *\\(D\\d*\\)/http:\\/\\/phabricator.khanacademy.org\\/\\1/'`; \
fi \n\
[ -z "$url" ] && echo "No phabricator url detected." || { \
echo \"Opening $url\"; \
xdg-open "$url" > /dev/null 2>&1 || open "$url"; } \
}; f"
[merge]
# Always show a diffstat at the end of a merge
stat = true
tool = opendiff
[diff]
# Use mnemonic prefixes (index, work tree, commit, object) instead of the standard a and b notation
mnemonicprefix = true
# Detect renames as well as copies
renames = copies
# Meld or opendiff
#external = /Applications/SourceTree.app/Contents/MacOS/SourceTree
#[init]
#templatedir = ~/.git_template
[push]
default = simple
[filter "lfs"]
clean = git-lfs clean %f
smudge = git-lfs smudge %f
required = true
[pull]
rebase = true