dotfiles/home/gitconfig
2024-05-20 10:07:28 -04:00

97 lines
4.0 KiB
Plaintext

[core]
excludesfile = ~/.gitignore_global
editor = nvim
symlinks = false
pager = less -F -X
[user]
email = tyrelsouza@gmail.com
name = Tyrel Souza
signingkey = F3614B02ACBE438E
[commit]
gpgsign = true
template = /Users/tyrel/.stCommitMsg
[color]
ui = auto # covers diff = true, status = auto, branch = auto
interactive = auto
[push]
default = current
[fetch]
prune = true
[format]
pretty = format:%C(auto)%h %C(green)%G? %C(red)%<(15,trunc)%aN %C(cyan)%<(15,trunc)%ar %C(white)%<(60,trunc)%s %C(auto)%d
[alias]
club = !club story $1 --git-branch
cleanslate = "!git reset $(git merge-base main $(git rev-parse --abbrev-ref HEAD))"
comit = commit
ab = "diff --name-only origin/main"
alias = "!git config -l | grep alias | cut -c 7-" # show all these aliases
bc = !git branch --merged main | grep -v main | xargs git branch -d # delete all merged branches
bcc = !git branch -vv | grep ': gone' | cut -d' ' -f1-3 | grep -v main | xargs git branch -D
d = diff --color-words # prettier diffs
files = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --numstat # Show files modified per commit
lf = "!git diff --name-only origin/main" # Show all file differing from origin/main
ll = log --stat --abbrev-commit # Way more information on git log
lp = log --stat -p --abbrev-commit # Way more information on git log
lb = log --stat --no-merges origin/main..
lfm = "!git diff --name-only origin/master" # Show all file differing from origin/main
lbm = log --stat --no-merges origin/master..
logtree= "log --graph --oneline --decorate --all" # show a tree with branches merging
noop="!git commit --allow-empty -m 'no op'"
ob = "!$EDITOR $(git diff --name-only origin/main)" # Open all files in editor that differ between origin/main and staged/unstaged
od = "!$EDITOR $(git diff --name-only origin/devel)" # Open all files in editor that differ between origin/main and staged/unstaged
oh = "!$EDITOR $(git diff --name-only HEAD)" # Open all changed files differ from current HEAD
p = push
recent = "!git for-each-ref --format=\"%(committerdate:relative) | %(refname)\" --sort=-committerdate refs/heads | sed '/main/d' | head -n 15" # get the most 10 recent branches worked on
scrum = log --since='1 day ago' --author='Tyrel Souza' --oneline
st = "!git log -n 1 && git status" # alias like `hg st`, because I like st, shorter is nice!
tabs = "!git diff --color | sed 's/\t/⌑/g'" # show tabs with ⌑ replacing tabs
v=describe --tags --match 'v*' # show the current version tag
# rd = !git diff $(git describe --tags --abbrev=0 --match v*)
# rl = !git log $(git describe --tags --abbrev=0 --match v*)..
# pr = !"pr() { git fetch origin pull/$1/head:pr-$1; git checkout pr-$1; }; pr"
# dsf = "!f() { [ \"$GIT_PREFIX\" != \"\" ] && cd "$GIT_PREFIX"; git diff --color $@ | diff-so-fancy | less --tabs=4 -RFX; }; f" # Diff so fancy!
[filter "lfs"]
clean = git-lfs clean %f
smudge = git-lfs smudge %f
required = true
[color "diff-highlight"]
oldNormal = red bold
oldHighlight = red bold 52
newNormal = green bold
newHighlight = green bold 22
[init]
templatedir = ~/.git_template
defaultBranch = main
[difftool "sourcetree"]
cmd = opendiff \"$LOCAL\" \"$REMOTE\"
path =
[mergetool "sourcetree"]
cmd = /Applications/Sourcetree.app/Contents/Resources/opendiff-w.sh \"$LOCAL\" \"$REMOTE\" -ancestor \"$BASE\" -merge \"$MERGED\"
trustExitCode = true
[diff]
tool = meld
[difftool]
prompt = false
[difftool "meld"]
trustExitCode = true
cmd = open -W -a Meld --args \"$LOCAL\" \"$REMOTE\"
[merge]
tool = meld
[mergetool]
prompt = false
[mergetool "meld"]
trustExitCode = true
cmd = open -W -a Meld --args --auto-merge \"$LOCAL\" \"$BASE\" \"$REMOTE\" --output=\"$MERGED\"
[protocol "http"]
allow = never
[protocol "git"]
allow = never
[fetch]
fsckObjects = true
[transfer]
fsckObjects = true
[receive]
fsckObjects = true