diff options
Diffstat (limited to 'create-git-repo.sh')
-rwxr-xr-x | create-git-repo.sh | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/create-git-repo.sh b/create-git-repo.sh new file mode 100755 index 0000000..b724fe9 --- /dev/null +++ b/create-git-repo.sh @@ -0,0 +1,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." |