-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.gitconfig
100 lines (90 loc) · 3.85 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
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
[user]
name = Sam
email = sam@
[push]
default = current
[merge]
conflictstyle = diff3
[fetch]
prune = true
[gc]
reflogExpire = never
reflogExpireUnreachable = never
auto = 0
[core]
whitespace=fix,-indent-with-non-tab,trailing-space,cr-at-eol
pager = less -XRMSIF
editor = vim
# https://chromium.googlesource.com/chromium/src.git/+/refs/heads/master/docs/mac_build_instructions.md#Improving-performance-of
untrackedCache = true
# More info: http://www.git-tower.com/blog/make-git-rebase-safe-on-osx/
trustctime = false
[color]
ui = true
interactive = always
diff = true
[color "diff"]
whitespace = red reverse
[credential]
helper = osxkeychain
[alias]
alog = log --date-order --all --graph --format=\"%C(green)%H%Creset %C(yellow)%an%Creset %C(blue bold)%ad%Creset %C(red bold)%d%Creset%s\"
st = status
ci = commit
br = branch
co = checkout
ls = ls-files
lg = log -p
l = log --oneline --no-merges
lgfiles = log --name-only --no-merges
lol = log --graph --decorate --pretty=oneline --abbrev-commit --no-merges
lola = log --graph --decorate --pretty=oneline --abbrev-commit --all --no-merges
lf = log --no-merges --oneline --
log-file = log --no-merges --
p = pick --local-only
# diff without whitespace
dw = diff -w -b --ignore-space-at-eol --ignore-blank-lines
# Take the changes that would be generated via git merge and apply them as a patch without committing
pc = "!f() { git diff HEAD..$1 | git apply -; }; f"
# Taken from https://github.com/jessfraz/dotfiles/blob/5ce693578b49f4d0561b3291ef2f4f4d767b90a6/.gitconfig
# Show the diff between the latest commit and the current state
d = !"git diff-index --quiet HEAD -- || clear; git --no-pager diff --patch-with-stat"
# `git di $number` shows the diff between the state `$number` revisions ago and the current state
di = !"d() { git diff --patch-with-stat HEAD~$1; }; git diff-index --quiet HEAD -- || clear; d"
# Remove branches that have already been merged with master
# a.k.a. ‘delete merged’
dm = "!git branch --merged | grep -v '\\*' | xargs -n 1 git branch -d; git remote -v update -p"
# Find branches containing commit
fb = "!f() { git branch -a --contains $1; }; f"
# Find tags containing commit
ft = "!f() { git describe --always --contains $1; }; f"
# Find commits by source code
fc = "!f() { git log --pretty=format:'%C(yellow)%h %Cblue%ad %Creset%s%Cgreen [%cn] %Cred%d' --decorate --date=short -S$1; }; f"
# Find commits by commit message
fm = "!f() { git log --pretty=format:'%C(yellow)%h %Cblue%ad %Creset%s%Cgreen [%cn] %Cred%d' --decorate --date=short --grep=$1; }; f"
# fetch ref
fetchref="!f() { git fetch origin \"+refs/heads/$1:refs/heads/$1\"; }; f"
# Taken from seth vargo https://gist.github.com/sethvargo/6b2f7b592853381690bfe3bd00947e8f
undo = !git reset HEAD~1 --mixed
# Taken from trevor bramble https://twitter.com/TrevorBramble/status/774292970681937920
alias=!git config -l | grep ^alias | cut -c 7- | sort
# My Submodule last-resort fix
# TODO: I still haven't found an elegant solution to submodules missing in .gitmodule
submodulefix = !git submodule update --init --recursive --force || (git submodule sync && git submodule foreach --recursive 'git submodule sync && git submodule update --init --force') || (git submodule deinit --all -f && git submodule update --init --recursive --force)
# Commits differing between branches
# TODO: doesn't work if branches point to the same commit
commitdiff="!f() { git log --left-right --graph --cherry-pick --oneline $1; }; f"
# From https://stackoverflow.com/a/4185907
showtag = !sh -c 'git rev-parse $1 | xargs git cat-file -p' -
[apply]
# Detect whitespace errors when applying a patch
whitespace = fix
[rerere]
enabled = 1
[url "[email protected]:"]
insteadOf = https://github.sc-corp.net/
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true