Commit 161cc77b authored by nimrod's avatar nimrod
Browse files

New Git command Init, create a new project in my Git hosting.

parent e6c28167
Loading
Loading
Loading
Loading

Documents/bin/git-Init

0 → 100755
+22 −0
Original line number Diff line number Diff line
#!/bin/sh
set -eu

die () {
    echo "$@"
    exit 1
}

usage () {
    die "Usage: $0 repo_name"
}

[ "$#" = "1" ] || usage
reponame="$1"
# shellcheck disable=SC2029
ssh cgit.shore.co.il "git init --bare /srv/git/$reponame"
git clone "cgit.shore.co.il:/srv/git/$reponame"
(
cd "$reponame"
git commit --allow-empty --message "Initial empty commit."
git push
)