-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitconfig_shared
68 lines (68 loc) · 2.09 KB
/
.gitconfig_shared
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
[alias]
# Force push but don't overwrite if the remote has been updated
pushf = push --force-with-lease
# --
# Don't show json files in the diff
show-no-json = diff HEAD~1 -- . ':(exclude)*.json'
# --
# Stash unstaged changes only
stashu = stash -k -u
# --
# Pull-rebase from master (or specified branch) with auto-stash.
main-sync = "!f() { git pull --rebase --autostash origin ${1:-master};}; f"
# --
# Delete branches that are already merged to master (or specified branch).
delete-merged = "!f() { local targetBranch=${1:-master} && git checkout -q $targetBranch && git branch --merged | grep -v \"\\*\" | xargs -n 1 git branch -d && git for-each-ref refs/heads/ \"--format=%(refname:short)\" | while read branch; do mergeBase=$(git merge-base $targetBranch $branch) && [[ $(git cherry $targetBranch $(git commit-tree $(git rev-parse $branch^{tree}) -p $mergeBase -m _)) == \"-\"* ]] && git branch -D $branch; done; }; f"
# --
# Switch back to the previous branch
back = switch -
# --
# Create a fixup commit on top of the latest commit
fixup = commit --fixup HEAD
# --
# Run elixir formatter before staging files
addex = "!f() { mix format && git add -p;}; f"
# --
# Finds outstanding "TODOs" introduced in this branch (vs main or specified branch)
todos = "!f() { git diff \"${1:-main}\" HEAD | grep --color=auto --exclude-dir={.bzr,CVS,.git,.hg,.svn,.idea,.tox} \"^+.*TODO\";}; f"
[core]
pager = diff-so-fancy | less --tabs=4 -RFX
editor = vim
[fetch]
prune = true
[diff]
tool = vscode
[difftool "vscode"]
cmd = code --wait --diff $LOCAL $REMOTE
[merge]
tool = vscode
[mergetool "vscode"]
cmd = code --wait $MERGED
[mergetool]
keepBackup = false
[color]
ui = true
[color "diff-highlight"]
oldNormal = red bold
oldHighlight = red bold 52
newNormal = green
newHighlight = green 22
[color "diff"]
meta = 11
frag = magenta bold
commit = yellow bold
old = red bold
new = green
whitespace = red reverse
[interactive]
diffFilter = "diff-so-fancy --patch"
[rerere]
enabled = 1
[pull]
ff = only
[init]
defaultBranch = main
[commit]
gpgsign = true
[gpg]
program = gpg