-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitconfig
50 lines (50 loc) · 1.98 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
[commit]
template = ~/.gitmessage
[init]
defaultBranch = main
[color]
ui = true
[fetch]
prune = true
[pull]
ff = only
[push]
default = simple
[log]
date = iso-local
follow = true
showSignature = true
[pager]
branch = false
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
[include]
path = ~/.gitconfig.local
[alias]
git-all = !sh -c 'find -L . -maxdepth $1 -type d -name .git ! -path ./.git | xargs -P$2 -I{} "git -C {}/.. ${@:3}"' -
all = git-all 2 8
all-one = git-all 2 1
deep = git-all 16 8
deep-one = git-all 16 1
edit = !sh -c 'edit $(git ls-files -m)'
br = !sh -c 'git rev-parse --abbrev-ref HEAD 2> /dev/null' -
changed = diff-tree --no-commit-id --name-only -r
clip = "!git log --no-show-signature -n1 --pretty=%B | xclip -selection c"
df = !sh -c 'cd "${GIT_PREFIX:-.}" && git diff -U$(wc -l < "$1") "$1"' -
first = "!git log $(git rev-list --max-parents=0 HEAD | tail -n1)"
gr = "!git --no-pager grep"
melog = "!git log --author=$(git config user.email) $@"
origin = remote get-url origin
pare = fetch --prune
pluck = "!sh -c 'DIR=$(basename \"${1%%.git*}\" 2> /dev/null); [ -n \"$DIR\" ] || exit 1; mkdir \"$DIR\" || exit 1; git -C \"$DIR\" init > /dev/null; git -C \"$DIR\" config core.sparseCheckout true; git -C \"$DIR\" remote add origin \"$1\"; echo \"$2\" >> \"$DIR\"/.git/info/sparse-checkout; git -C \"$DIR\" pull origin master --depth 1 || (rm -fr \"$DIR\"; exit 1)'" -
rb = !sh -c 'git rebase -i HEAD~$1' -
remotes = "!git remote -v | awk \"{ print \\$1OFS\\$2 }\" | sort -u | column -t"
show-patch = "!git format-patch -1 $1 --stdout"
sign = commit --amend --no-edit -S
stat = show --stat
tags = ls-remote --tags --sort='v:refname'
user = "!sh -c \"if [ $# -ne 1 ]; then echo "$(git config user.name) \\<$(git config user.email)\\>"; exit 0; fi; git config user.email "$(git config gituser.$1.email)" &> /dev/null; git user;\" --" -
who = shortlog -ns