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

set -E

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

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

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