diff options
author | garhve <git@garhve.com> | 2024-09-16 11:51:26 +0800 |
---|---|---|
committer | garhve <git@garhve.com> | 2024-09-16 11:51:26 +0800 |
commit | 501cc7914293366dfb167ebd87256fd43532e8ed (patch) | |
tree | 7da202bee63b7ceb79b875bed60654daf3c7ce65 | |
parent | b25ba7ac30630c1b664534089778b87af6c723b1 (diff) |
add git/awesome
-rw-r--r-- | .config/git/config | 16 | ||||
-rwxr-xr-x | .config/git/git_template/hooks/post-commit | 3 | ||||
-rwxr-xr-x | .config/git/git_template/hooks/post-receive | 12 | ||||
-rw-r--r-- | .config/git/gitignore_global | 4 |
4 files changed, 35 insertions, 0 deletions
diff --git a/.config/git/config b/.config/git/config new file mode 100644 index 0000000..a666fe5 --- /dev/null +++ b/.config/git/config @@ -0,0 +1,16 @@ +[user] + name = garhve + email = git@garhve.com + signingkey = gpg@garhve.com +[core] + editor = vim + excludesfile = ~/.config/git/gitignore_global + hooksPath = ~/.config/git/git_template/hooks +[init] + defaultBranch = main +[credential] + helper = store +[commit] + gpgsign = true +[gitweb] + owner = garhve diff --git a/.config/git/git_template/hooks/post-commit b/.config/git/git_template/hooks/post-commit new file mode 100755 index 0000000..6d5dc58 --- /dev/null +++ b/.config/git/git_template/hooks/post-commit @@ -0,0 +1,3 @@ +#! /bin/bash + +git push origin main diff --git a/.config/git/git_template/hooks/post-receive b/.config/git/git_template/hooks/post-receive new file mode 100755 index 0000000..f40fac0 --- /dev/null +++ b/.config/git/git_template/hooks/post-receive @@ -0,0 +1,12 @@ +#! /bin/sh + +repo="$(pwd | rev | cut -d '/' -f1 | rev)" +git --work-tree=/home/pico/git/"$repo" -git-dir=/home/pico/.local/git/"$repo" checkout -f + +agefile="$(git rev-parse --git-dir)"/info/web/last-modified + +mkdir -p "$(dirname "$agefile")" && +git for-each-ref \ + --sort=-authordate --count=1 \ + --format='%(authordate:iso8601)' \ + >"$agefile" diff --git a/.config/git/gitignore_global b/.config/git/gitignore_global new file mode 100644 index 0000000..6fb5384 --- /dev/null +++ b/.config/git/gitignore_global @@ -0,0 +1,4 @@ +.DS_Store +a.out +.gitmodules +target/ |