summaryrefslogtreecommitdiff
path: root/git-create
blob: 48fa1d77fd4e7597ec86985e42d74bf4dbf1b37a (plain) (blame)
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
32
#!/bin/sh

# TODO: update this for gitea, insta-creation of repo

# create a repo of provided name on macon and make it the upstream
name=$1
[ ! $(echo "$name" | grep ".git" -) ] && name="$1.git"

description=$2

echo "'$name': '$description'"
echo "Create repo?"
read choice
[ ! $choice == "y" ] && exit 1

ssh git@53hor.net << EOF
    cd /srv/git
    git init --bare /srv/git/"$name"
    cd "$name"
    rm description
    echo "$description" > description
EOF

echo "Mark for export (make clone-able)?"
read choice
[[ $choice == "y" ]] && ssh git@53hor.net touch /srv/git/"$name"/git-daemon-export-ok

echo "Clone repo locally?"
read choice
[[ ! $choice == "y" ]] && exit 1

git clone git@53hor.net:/srv/git/"$name"