summaryrefslogtreecommitdiff
path: root/git-shell-commands/create-bare-repo
blob: 6c83bc6ee4f0a74ff19d6293d4780d5e461602cd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/sh
# * create-bare-repo
#   Allows users to create repo.git
#   ssh git@host create-bare-repo repo1 repo2 ...

set -e

for i in $@; do
# Cleanup names
    repo="`echo "$i" | sed "s/[^a-z0-9\._-]//gi"`"

    if [ -z "$repo" ]; then continue; fi

    mkdir "$repo".git
    pushd "$repo".git
    git init --bare
done