summaryrefslogtreecommitdiffstats
path: root/create-git-repo.sh
blob: b724fe9a914aed55f9c3256b12d697e19d30081b (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
#!/bin/zsh

if [[ -z $1 ]]; then
  echo "$(basename $0) <reponame>"
  exit 1
fi

repo=$1
server="karif"
remotename="karif"
basepath=/srv/git/users/flo

ssh $server mkdir $basepath/$repo
ssh $server git init --bare $basepath/$repo
ssh $server touch $basepath/$repo/git-daemon-export-ok

git remote add $remotename ssh://${server}${basepath}/$repo
echo -n "Description: "
read description
ssh $server echo $description \> $basepath/$repo/description

echo -n "Branch to push: "
read branch
git push $remotename $branch

echo "All done."