Skip to content
Snippets Groups Projects
Commit 161cc77b authored by nimrod's avatar nimrod
Browse files

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

parent e6c28167
No related branches found
No related tags found
No related merge requests found
#!/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
)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment