diff options
| author | Elizabeth Hunt <me@liz.coffee> | 2025-12-05 22:40:48 -0800 |
|---|---|---|
| committer | Elizabeth Hunt <me@liz.coffee> | 2025-12-05 22:40:48 -0800 |
| commit | a1585e0c26fe78d675c9ef2cace389fd4aeca9cc (patch) | |
| tree | f3873e1c035e014e3d84e5af23025aa682192949 /init-repo | |
| parent | 8667f8615da479a8e9c4e8d5bb5987632d75bfaf (diff) | |
| download | wwwgit-a1585e0c26fe78d675c9ef2cace389fd4aeca9cc.tar.gz wwwgit-a1585e0c26fe78d675c9ef2cace389fd4aeca9cc.zip | |
Fix description flags
Diffstat (limited to 'init-repo')
| -rw-r--r-- | init-repo | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -2,7 +2,7 @@ # Helper script for git-shell to initialize bare repositories # Usage: ssh code@host init-repo <repo-name> [description] -if [ $# -lt 1 ] || [ $# -gt 2 ]; then +if [ $# -lt 1 ]; then echo "Usage: init-repo <repo-name> [description]" echo "Example: init-repo myproject.git" echo "Example: init-repo myproject.git 'A repo with foo'" @@ -10,7 +10,8 @@ if [ $# -lt 1 ] || [ $# -gt 2 ]; then fi REPO_NAME="$1" -DESCRIPTION="$2" +shift +DESCRIPTION="$*" # Ensure it ends with .git case "$REPO_NAME" in @@ -26,7 +27,7 @@ if [ -e "$REPO_DIR" ]; then fi echo "Initializing bare repository: $REPO_NAME" -git init --bare "$REPO_DIR" +git init --bare --initial-branch=main "$REPO_DIR" # Add description if provided if [ -n "$DESCRIPTION" ]; then |
