-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitconfig
22 lines (20 loc) · 1023 Bytes
/
.gitconfig
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
[user]
name = Heron Silva
[core]
excludesfile = ~/.gitignore_global
editor = nvim
autocrlf = input
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
[alias]
undo = reset --soft HEAD^
# https://stackoverflow.com/questions/8475448/find-merge-commit-which-includes-a-specific-commit
find-merge = "!sh -c 'commit=$0 && branch=${1:-HEAD} && (git rev-list $commit..$branch --ancestry-path | cat -n; git rev-list $commit..$branch --first-parent | cat -n) | sort -k2 -s | uniq -f1 -d | sort -n | tail -1 | cut -f2'"
show-merge = "!sh -c 'merge=$(git find-merge $0 $1) && [ -n \"$merge\" ] && git show $merge'"
sync = "!sh -c 'git fetch --all --tags --prune --jobs=10 && git pull --rebase'"
clean-branches = "!f() { for branch in $(git for-each-ref --format '%(refname) %(upstream:track)' refs/heads | awk '$2 == \"[gone]\" {sub(\"refs/heads/\", \"\", $1); print $1}'); do git branch -D $branch; done }; f"
[pull]
rebase = true