Add git config

This commit is contained in:
Dan Barber 2024-09-26 17:22:27 -05:00
parent 6053770c8d
commit 3d3b1773d9
14 changed files with 170 additions and 0 deletions

56
dot_config/git/config Normal file
View File

@ -0,0 +1,56 @@
[init]
defaultBranch = main
templatedir = ~/.config/git/template
[push]
default = current
[pull]
rebase = false
[color]
ui = auto
[alias]
aa = add --all
ap = add --patch
ci = commit -v
co = checkout
pf = push --force-with-lease
st = status
ksdiff = difftool -yt Kaleidoscope
[core]
excludesfile = ~/.config/git/ignore
autocrlf = input
[merge]
ff = only
[commit]
template = ~/.config/git/message
[fetch]
prune = true
[rebase]
autosquash = true
instructionFormat = (%al) %s
[diff]
colorMoved = zebra
external = difft
tool = difftastic
[difftool]
prompt = false
[difftool "difftastic"]
cmd = difft "$LOCAL" "$REMOTE"
[credential]
helper = osxkeychain
[format]
pretty = %Cblue%h%Creset %Cgreen[%ar]%Creset (%an) %s
[color "diff"]
oldMoved = 141
newMoved = 39
[include]
path = config.author
[filter "lfs"]
required = true
clean = git-lfs clean %f
smudge = git-lfs smudge %f
[pager]
difftool = true
[tig]
status-show-untracked-files = yes
[rerere]
enabled = true

View File

@ -0,0 +1,6 @@
[commit]
# gpgsign = true
[user]
name = Dan Barber
email = {{ .email | quote }}
# signingkey = A0B1C2D3

17
dot_config/git/ignore Normal file
View File

@ -0,0 +1,17 @@
*.pyc
*.sw[nop]
.DS_Store
.bundle
.byebug_history
.env
.git/
.nvim.lua
/bower_components/
/log
/node_modules/
/tmp
db/*.sqlite3
log/*.log
rerun.txt
tmp/**/*
/tags

16
dot_config/git/message Normal file
View File

@ -0,0 +1,16 @@
# 50-character subject line
#
# 72-character wrapped longer description. This should answer:
#
# * Why was this change necessary?
# * How does it address the problem?
# * Are there any side effects?
#
# Include a link to the ticket, if any.
#
# Add co-authors if you worked on this code with others:
#
# Co-authored-by: Full Name <email@example.com>
# Co-authored-by: Full Name <email@example.com>

View File

@ -0,0 +1,7 @@
#!/bin/sh
local_hook="$HOME"/.git_template.local/hooks/commit-msg
if [ -f "$local_hook" ]; then
. "$local_hook"
fi

View File

@ -0,0 +1,10 @@
#!/bin/sh
set -e
PATH="/usr/local/bin:$PATH"
dir="$(git rev-parse --git-dir)"
trap 'rm -f "$dir/$$.tags"' EXIT
git ls-files | \
"${CTAGS:-ctags}" --tag-relative=yes -L - -f"$dir/$$.tags" --languages=-javascript,sql
mv "$dir/$$.tags" "$dir/tags"

View File

@ -0,0 +1,9 @@
#!/bin/sh
local_hook="$HOME"/.git_template.local/hooks/post-checkout
if [ -f "$local_hook" ]; then
. "$local_hook";
fi
.git/hooks/ctags >/dev/null 2>&1 &

View File

@ -0,0 +1,9 @@
#!/bin/sh
local_hook="$HOME"/.git_template.local/hooks/post-commit
if [ -f "$local_hook" ]; then
. "$local_hook";
fi
.git/hooks/ctags >/dev/null 2>&1 &

View File

@ -0,0 +1,9 @@
#!/bin/sh
local_hook="$HOME"/.git_template.local/hooks/post-merge
if [ -f "$local_hook" ]; then
. "$local_hook";
fi
.git/hooks/ctags >/dev/null 2>&1 &

View File

@ -0,0 +1,4 @@
#!/bin/sh
case "$1" in
rebase) exec .git/hooks/post-merge ;;
esac

View File

@ -0,0 +1,7 @@
#!/bin/sh
local_hook="$HOME"/.git_template.local/hooks/pre-commit
if [ -f "$local_hook" ]; then
. "$local_hook"
fi

View File

@ -0,0 +1,7 @@
#!/bin/sh
local_hook="$HOME"/.git_template.local/hooks/pre-push
if [ -f "$local_hook" ]; then
. "$local_hook"
fi

View File

@ -0,0 +1,7 @@
#!/bin/sh
local_hook="$HOME"/.git_template.local/hooks/prepare-commit-msg
if [ -f "$local_hook" ]; then
. "$local_hook"
fi

View File

@ -0,0 +1,6 @@
# git ls-files --others --exclude-from=.git/info/exclude
# Lines that start with '#' are comments.
# For a project mostly in C, the following would be a good set of
# exclude patterns (uncomment them if you want to use them):
# *.[oa]
# *~