This commit is contained in:
rozbrian
2026-01-10 20:46:22 +09:00
commit 304cbcc554
66 changed files with 1291 additions and 0 deletions

27
git_repo.sh Executable file
View File

@@ -0,0 +1,27 @@
#!/bin/bash
# This script creates a bare Git repository under /home/git/
# Usage: ./create-git-repo.sh <project_name>
set -e
if [ -z "$1" ]; then
echo "Error: Project name is required."
echo "Usage: $0 <project_name>"
exit 1
fi
PROJECT_NAME=$1
REPO_PATH="/home/git/${PROJECT_NAME}.git"
# Create the directory
mkdir -p "$REPO_PATH"
# Initialize as bare repository
git init --bare "$REPO_PATH"
# Set ownership to user 'git'
chown -R git:git "$REPO_PATH"
echo "=== Repository created successfully ==="
echo "Path: $REPO_PATH"
echo "To clone: git clone git@your-server:${PROJECT_NAME}.git"