Joined December 2015
·

Shohel Khatri
Pune Area, India
·
Posted to
Create a new Gitlab repo from the command line
over 1 year
ago
There are multiple errors in the script ("repo" and "repo_name" variables are used interchangeably) for those who are getting errors, use this rectified version:
!/bin/sh
reponame=$1
token=yourapitokenhere
test -z $repo_name && echo "Repo name required." 1>&2 && exit 1
curl -H "Content-Type:application/json" http://your_domain_or_ip_here/api/v3/projects?private_token=$token -d "{ \"name\": \"$repo_name\" }"
Really Helpful! Cheers!