-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitconfig
53 lines (46 loc) · 2.02 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
[user]
name = Matt Rohr
email = [email protected]
# Public key, available for viewing on signed commits
signingkey = C6C3DD2A201ED90B
[push]
# Refuse to push if the upstream branch’s name is different from the local one
default = simple
[core]
# Specify global files to ignore, in addition to any local .gitignore
excludesfile = ~/.gitignore_global
# Specify editor of choice, and wait for editor to exit before proceeding
editor = 'code' --wait
[alias]
one = log --all --oneline --pretty=format:'%C(auto)%h %s %C(dim)(%aN, %ar) %C(auto)%d'
graph = log --all --graph --pretty=format:'%C(auto)%h %s %C(dim)(%aN, %ar) %C(auto)%d'
last = log -1 HEAD
# Show all branches, even across remotes
branches = branch -a --color -v
# Search commits by commit message
search = "!f() { git log --pretty=format:'%C(auto)%h %s %C(dim)(%aN, %ar) %C(auto)%d' --grep=$1; }; f"
# Combine with ~/.aliases `cdgr` to change directory to git repository root
root = rev-parse --show-toplevel
# Show developer contributions
count = ! "echo "Commits:" && git shortlog -sn && echo "Lines:" && lc() { git ls-tree --name-only -z -r HEAD | xargs -0 -n1 git diff --no-index --numstat /dev/null 2>/dev/null | grep -v '^-' | cut -f 3- | cut -d ' ' -f 3- | xargs -n1 git blame --line-porcelain | grep '^author ' | cut -d ' ' -f 2- | sort | uniq -c | sort -nr; }; lc"
# Acknowledge co-author(s)
# Example: `git credit "Linus Torvalds" [email protected]`
credit = "!f() { \
if [ -n \"$1\" ] && [ -n \"$2\" ]; then \
GIT_EDITOR=\"git interpret-trailers --in-place --trailer='Co-authored-by: $1 <$2>'\" git commit --amend; \
fi \
}; f"
[color]
ui = auto
[commit]
# Sign all commits automatically without need for -s flag
gpgsign = true
[credential]
# Cache personal access token for cloning, pulling, and committing over HTTPS
helper = osxkeychain
[pull]
ff = only
[gpg]
program = gpg
[diff]
tool = vimdiff