This repository has been archived by the owner on Jun 20, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitconfig
106 lines (96 loc) · 4.25 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
101
102
103
104
105
106
[alias]
br = branch
# Commit commands
ci = commit
cian = commit --amend --no-edit
co = checkout
cp = cherry-pick
# https://stackoverflow.com/questions/3713765/viewing-all-git-diffs-with-vimdiff
df = difftool
# GNU find will work regardless of whether you're in a git repository, but
# it will critically not know to ignore the html, HDR-data, etc. directories.
f = "!git ls-files | grep --ignore-case"
g = grep --no-color -WEIn --heading
# A "quick" view of recent commits, inspired by the command here:
# https://github.com/mathiasbynens/dotfiles/blob/master/.gitconfig
#
# All of these aliases are helpful because gitk takes a long time (15 or
# so seconds) over ssh (and requires that -X be enabled).
l = !"git lg1 -20"
# The following aliases were taken from:
# https://stackoverflow.com/a/34467298/622049
lg = !"git lg1"
lg1 = !"git lg1-specific --all"
lg1-specific = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(auto)%d%C(reset)'
lg2 = !"git lg2-specific --all"
lg2-specific = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(auto)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)'
lg3 = !"git lg3-specific --all"
lg3-specific = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset) %C(bold cyan)(committed: %cD)%C(reset) %C(auto)%d%C(reset)%n'' %C(white)%s%C(reset)%n'' %C(dim white)- %an <%ae> %C(reset) %C(dim white)(committer: %cn <%ce>)%C(reset)'
# Mnemonic: Recursive pull
#
# You used to "git fetch" then "git rebase" separately so you could review
# all changes before integrating them, but I don't think that's a good use
# of time. It'd be better to be reading code or learning something in
# focused work.
rpull = "!git pull --rebase && git submodule update --rebase --recursive"
st = status
[blame]
coloring = highlightRecent
[core]
# Use vim to edit commit messages:
# https://git-scm.com/docs/git-config#git-config-coreeditor
editor = vim
# Use custom `.gitignore`
excludesfile = ~/.gitignore_global
[diff]
# See:
# https://git-scm.com/docs/git-difftool
#
# Prefer difftool to diff to get better colors.
# Prefer difftool to remote tools like GitLab.
#
# Prefer vimdiff to meld so:
# - You can use your keyboard to navigate diffs.
# - You can use difftool over ssh.
tool = vimdiff
[difftool]
# Prompt before each invocation of the diff tool:
# https://git-scm.com/docs/git-config#git-config-difftoolprompt
#
# It's harder to get out of vimdiff (with :wq i.e. 3 characters) than meld. You only
# have to type one letter with this system.
prompt = true
# To be able to cancel a git difftool (git df) comparison part way through:
# https://stackoverflow.com/questions/2786619
trustExitCode = true
[gitreview]
# Search "git config --global gitreview.remote origin" on this page:
# https://nofluffjuststuff.com/magazine/2016/04/understanding_and_applying_gerrit_part_3_gerrit_submit_types_and_git_review
remote = origin
[include]
path = ~/.gitconfig_local
[merge]
# https://stackoverflow.com/a/163659/622049
tool = vimdiff
conflictstyle = diff3
[mergetool]
prompt = false
# https://stackoverflow.com/questions/1251681/git-mergetool-generates-unwanted-orig-files
keepBackup = false
[pager]
# You use VIM as a your "git grep" pager so that you have CPP highlighting
# (something git will never be able to do).
#
# A side effect is that you can use your VIM cursor to follow tags in these
# searches.
#
# See:
# https://git-scm.com/docs/git-config#git-config-pagerltcmdgt
g = vim -c 'set syn=cpp' -R -
[rebase]
# See --autosquash on the git rebase command:
# https://git-scm.com/docs/git-rebase#git-rebase---no-autosquash
#
# This article explains the feature in more detail:
# https://robots.thoughtbot.com/autosquashing-git-commits
autosquash = true