mirror of
https://git.sr.ht/~danbarber/dotfiles
synced 2025-03-04 08:59:18 +00:00
Add git config
This commit is contained in:
parent
6053770c8d
commit
3d3b1773d9
56
dot_config/git/config
Normal file
56
dot_config/git/config
Normal 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
|
||||
6
dot_config/git/config.author.tmpl
Normal file
6
dot_config/git/config.author.tmpl
Normal file
@ -0,0 +1,6 @@
|
||||
[commit]
|
||||
# gpgsign = true
|
||||
[user]
|
||||
name = Dan Barber
|
||||
email = {{ .email | quote }}
|
||||
# signingkey = A0B1C2D3
|
||||
17
dot_config/git/ignore
Normal file
17
dot_config/git/ignore
Normal 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
16
dot_config/git/message
Normal 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>
|
||||
7
dot_config/git/template/hooks/executable_commit-msg
Normal file
7
dot_config/git/template/hooks/executable_commit-msg
Normal file
@ -0,0 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
local_hook="$HOME"/.git_template.local/hooks/commit-msg
|
||||
|
||||
if [ -f "$local_hook" ]; then
|
||||
. "$local_hook"
|
||||
fi
|
||||
10
dot_config/git/template/hooks/executable_ctags
Normal file
10
dot_config/git/template/hooks/executable_ctags
Normal 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"
|
||||
9
dot_config/git/template/hooks/executable_post-checkout
Normal file
9
dot_config/git/template/hooks/executable_post-checkout
Normal 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 &
|
||||
9
dot_config/git/template/hooks/executable_post-commit
Normal file
9
dot_config/git/template/hooks/executable_post-commit
Normal 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 &
|
||||
9
dot_config/git/template/hooks/executable_post-merge
Normal file
9
dot_config/git/template/hooks/executable_post-merge
Normal 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 &
|
||||
4
dot_config/git/template/hooks/executable_post-rewrite
Normal file
4
dot_config/git/template/hooks/executable_post-rewrite
Normal file
@ -0,0 +1,4 @@
|
||||
#!/bin/sh
|
||||
case "$1" in
|
||||
rebase) exec .git/hooks/post-merge ;;
|
||||
esac
|
||||
7
dot_config/git/template/hooks/executable_pre-commit
Normal file
7
dot_config/git/template/hooks/executable_pre-commit
Normal file
@ -0,0 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
local_hook="$HOME"/.git_template.local/hooks/pre-commit
|
||||
|
||||
if [ -f "$local_hook" ]; then
|
||||
. "$local_hook"
|
||||
fi
|
||||
7
dot_config/git/template/hooks/executable_pre-push
Normal file
7
dot_config/git/template/hooks/executable_pre-push
Normal file
@ -0,0 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
local_hook="$HOME"/.git_template.local/hooks/pre-push
|
||||
|
||||
if [ -f "$local_hook" ]; then
|
||||
. "$local_hook"
|
||||
fi
|
||||
@ -0,0 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
local_hook="$HOME"/.git_template.local/hooks/prepare-commit-msg
|
||||
|
||||
if [ -f "$local_hook" ]; then
|
||||
. "$local_hook"
|
||||
fi
|
||||
6
dot_config/git/template/info/exclude
Normal file
6
dot_config/git/template/info/exclude
Normal 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]
|
||||
# *~
|
||||
Loading…
Reference in New Issue
Block a user