diff options
author | gennyble <gen@nyble.dev> | 2025-02-08 05:06:31 -0600 |
---|---|---|
committer | gennyble <gen@nyble.dev> | 2025-02-08 05:07:45 -0600 |
commit | 76cd514a475bb0a1b02315dbed4a4ff54d275a02 (patch) | |
tree | cab0827a0a18b23b6b8763cb469fb3152a40c546 | |
parent | 5c3393401e1690ffe66ef737eddfa6b670569ee9 (diff) | |
download | 🌦-76cd514a475bb0a1b02315dbed4a4ff54d275a02.tar.gz 🌦-76cd514a475bb0a1b02315dbed4a4ff54d275a02.zip |
-rwxr-xr-x | git-set-head | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/git-set-head b/git-set-head new file mode 100755 index 0000000..a68f718 --- /dev/null +++ b/git-set-head @@ -0,0 +1,24 @@ +#! /usr/bin/env bash +# +# usage: +# git set-head <branch> +# +# example: +# $ git set-head main +# modifies the current git repos origin config so that cgit knows +# what branch is the main and can correctly set the time since it +# was last modified + +HOST=gen@quartet +CGIT_ROOT=git + +if [ $# -eq 0 ]; then + echo "requires an arg" + exit 1 +fi + +# [cgit] +# defbranch = main + +remote=$(git remote get-url --push origin | cut -d ':' -f 2) +ssh $HOST echo -e "\n\n[cgit]\n\tdefbranch = $1" \>\> "$remote/config" |