gitservconf/git-shell-commands/create
2024-08-12 16:26:09 +02:00

10 lines
225 B
Bash
Executable file

#!/bin/bash
if [ "$#" -ne 1 ]; then
echo "Usage: create <path_to_repository>"
exit 1
fi
REPO_PATH="/srv/git/$1"
mkdir -p "$REPO_PATH"
cd "$REPO_PATH" && git init --bare
echo "New bare git repo created at $REPO_PATH"