-
Notifications
You must be signed in to change notification settings - Fork 1
/
gitconfig
38 lines (37 loc) · 1.41 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
[user]
name = Steven Hicks
email = [email protected]
[includeIf "gitdir:~/sjh/dev/personal/"]
path = .gitconfig-personal
[alias]
log1 = "!git --no-pager log --oneline -n 10"
logtree = "!git --no-pager log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit -n 10"
discard = !git clean -df . && git restore --staged --worktree .
branch-name = rev-parse --abbrev-ref HEAD
fix = "commit --amend --no-edit"
# these two work when PRs are squash-merged. (source: https://stackoverflow.com/a/30494276)
list-merged-branches = !git branch -vv | grep ': gone]' | awk '{print $1}'
delete-merged-branches = !git list-merged-branches | xargs git branch -D
# these two work when PRs are not squash-merged.
# delete-merged-branches = !git branch --merged main | grep -v -e 'main' -e '\\*' | xargs -n 1 git nuke
# list-merged-branches = !git branch --merged main | grep -v -e 'main' -e '\\*'
nuke = !git branch -D $1 && git push origin --delete
alias = ! git config --get-regexp ^alias\\. | sed -e s/^alias\\.// -e s/\\ /\\ =\\ /
unstage = !git restore --staged $1
[pull]
ff = only
[github]
user = pepopowitz
# delta as a replacement for diff:
[core]
pager = delta
[delta]
syntax-theme = Monokai Extended Light
side-by-side = true
line-numbers = true
[interactive]
diffFilter = delta --color-only
[init]
defaultBranch = main
[push]
autoSetupRemote = true