summary refs log tree commit diff
path: root/git-new-repo
blob: ef5fead22c99af15e65a144bedc31c378bd7602e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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}"