-
Notifications
You must be signed in to change notification settings - Fork 4
/
.gitconfig
41 lines (33 loc) · 1.34 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
## include this from ~/.gitconfig
# [include]
# path = code/dot-file/.gitconfig
[core]
whitespace = trailing-space,space-before-tab
[commit]
gpgSign = true
[init]
defaultBranch = main
[url "git@github.com:"]
insteadOf = https://github.com/
[alias]
ref = rev-parse --abbrev-ref HEAD
assume = update-index --assume-unchanged
unassume = update-index --no-assume-unchanged
assumed = "!git ls-files -v | grep ^h | cut -c 3-"
ours = "!f() { git checkout --ours $@ && git add $@;};f"
theirs = "!f() { git checkout --theirs $@ && git add $@;};f"
tags = log --tags --simplify-by-decoration --pretty='format:%ai %d'
fetch-pulls = "!f(){ set -x; git fetch \"$1\" \"+refs/pull/*/head:refs/remotes/$1/pull/*\";};f"
fetch-backups = "!f(){ b=${2:-${GIT_USER:-$USER}}; set -x; git fetch \"$1\" \"+refs/remotes/$b/*:refs/remotes/$1/$b/*\";};f"
push-backups = "!f(){ b=${2:-${GIT_USER:-$USER}}; set -x; git push \"$1\" \"+refs/he/$b/*:refs/remotes/$1/$b/*\";};f"
branch-clean = "!f(){ set -x; git branch -d \"$1\" && git push origin :\"$1\";};f"
unadded = ls-files -o --exclude-standard
rank = "shortlog -s -n -e --no-merges"
empty = "git commit --allow-empty"
[diff]
renames = copies # detect copies as renames too
noprefix = true # file names in diffs are real paths
[push]
default = simple
[pull]
rebase = true