-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitconfig
97 lines (89 loc) · 2.7 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
[user]
name = shionit
email = [email protected]
[core]
editor = vim
excludesfile = ~/.gitignore
attributesfile = ~/.gitattributes
quotepath = false
autocrlf = input
[include]
path = ~/.gitconfig.local
[color]
branch = auto
diff = auto
grep = auto
interactive = auto
status = auto
ui = auto
[init]
defaultBranch = main
[alias]
alias = !git config --list | grep 'alias\\.' | sed 's/alias\\.\\([^=]*\\)=\\(.*\\)/\\1\\=> \\2/' | sort
amend = "commit --amend -C HEAD"
br = branch -vv
ci = commit -v
co = checkout
cot = !"c() { git checkout -b $1 --track origin/$1; }; c"
f = fetch --prune
info = remote show origin
l = log --pretty=oneline -n 20 --graph --abbrev-commit
lg = log --graph -n 20 --pretty=format:'%C(yellow)%h%C(cyan)%d%Creset %s %C(green)- %an, %cr%Creset'
ll = log --stat --abbrev-commit
ln = log --graph -n 20 --pretty=format:'%C(yellow)%h%C(cyan)%d%Creset %s %C(green)- %an, %cr%Creset' --name-status
rh = reset --hard HEAD
rhh = reset --hard HEAD^
s = status -sb
st = status
today = log --oneline --since='18 hour ago'
unstage = reset HEAD
# 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"
# Commit all changes
ca = !git add -A && git commit -av
# Remove branches that have already been merged with main
# a.k.a. ‘delete merged’
dm = "!git branch --merged | grep -v '\\*' | grep -v main | xargs -n 1 git branch -d"
sync = !git checkout main && git pull origin main && git fetch -p origin && git dm
#Checkout pull request merged commit
copr = !"c() { git fetch origin +refs/pull/$1/merge:refs/remotes/pull/$1/merge -f && git checkout -b $1-merged pull/$1/merge; }; c"
# Delete merged (pull request) branches
dmp = !git branch | grep merged | xargs git branch -D
# Delete unstaged files
duf = "!git status --short | grep '??' | awk '{print $2}' | xargs rm -rf"
# Show verbose output about tags, branches or remotes
tags = tag -l
branches = branch -a
remotes = remote -v
[push]
# push only the current branch
default = current
[pull]
ff = only
[merge]
ff = false
[grep]
lineNumbers = true
[branch "master"]
mergeoptions = --no-ff
rebase = true
[branch "main"]
mergeoptions = --no-ff
rebase = true
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "diff"]
meta = yellow bold
frag = magenta bold # line info
old = red # deletions
new = green # additions
[color "status"]
added = yellow
changed = green
untracked = cyan
[http]
postbuffer = 4M