diff options
author | gennyble <gen@nyble.dev> | 2023-11-23 14:15:40 -0600 |
---|---|---|
committer | gennyble <gen@nyble.dev> | 2023-11-23 14:15:40 -0600 |
commit | c5111b3482bd867e13b1d835c9779765dff73d4f (patch) | |
tree | b95662e34012e26cd9a3c536466908a0a7d2d193 /git-new-repo | |
download | 🌦-c5111b3482bd867e13b1d835c9779765dff73d4f.tar.gz 🌦-c5111b3482bd867e13b1d835c9779765dff73d4f.zip |
init :)
Diffstat (limited to 'git-new-repo')
-rwxr-xr-x | git-new-repo | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/git-new-repo b/git-new-repo new file mode 100755 index 0000000..ef5fead --- /dev/null +++ b/git-new-repo @@ -0,0 +1,31 @@ +#! /usr/bin/env bash +# +# usage: +# git new-repo section/repo-name +# +# example: +# git new-repo fonts/scientifica +# creates: user@remote:fonts/scientifica +# +# script written by Akshay and seen on +# <https://peppe.rs/posts/self-hosting_git/> +# and gently modified by me +# (added the echo and got carried away with colour) + +HOST=gen@quartet +CGIT_ROOT=git + +if [ $# -eq 0 ]; then + echo "requires an arg" + exit 1 +fi + +IBlack="\033[0;90m" +White="\033[0;37m" +Yellow="\033[0;33m" +Reset="\033[0m" + +echo -en "${IBlack}" +ssh $HOST git init --bare "$CGIT_ROOT/$1"; +echo -e "${White}Add it as remote 'origin' with the command" +echo -e "${IBlack}$ ${Yellow}git remote add origin ${HOST}:$CGIT_ROOT/$1${Reset}" |