-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitconfig
26 lines (26 loc) · 1.27 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
[core]
editor = vim
excludesfile = /Users/joshuanovak/.gitignore
autocrlf = input
hooksPath = ~/.git-scripts/hooks
[user]
name = Joshua Novick
email = joshua.novick@hunters.ai
[alias]
cleanup = !git fetch origin --prune && git branch --merged origin/master | grep -v 'master$' | xargs git branch -d
changelog = !~/.git-scripts/gitChangelog.sh
info = !~/.git-scripts/gitInfo.sh
start = !~/.git-scripts/gitStart.sh
redo = !git commit -a --amend -C HEAD && git push --force-with-lease
repull = !git fetch && git branch "$(git rev-parse --abbrev-ref HEAD)_BACKUP_$(date +"%Y_%m_%d_%I_%M_%p")" && git reset --hard $(git for-each-ref --format='%(upstream:short)' $(git symbolic-ref -q HEAD))
go = !cd /Users/joshuanovak/git/
compare = "!f() { \
OTHER=${2:-$(git symbolic-ref -q HEAD --short)}; \
git rev-list \"$1\"...\"$2\" --count --left-right | awk -v A=\"$1\" -v B=\"$OTHER\" '{print A,\"is\",\"\\033[32m\"$1\"\\033[39m\",\"commits ahead of\",B,\"and\",\"\\033[31m\"$2\"\\033[39m\",\"behind\"}'; \
}; f"
mr = "!f() { git push -u origin $(git symbolic-ref -q HEAD) }; f"
track = "!f() { git config branch.$1.remote origin && git config branch.$1.merge refs/heads/$1 }; f"
[push]
default = current
[pull]
rebase = false