Created
December 3, 2016 21:54
-
-
Save hedefalk/19bd90f097a21ca90763fe6218910cae to your computer and use it in GitHub Desktop.
push a new repo to gitlab
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
repo_name=$1 | |
token=`pass show gitlab/access-token` | |
test -z $repo_name && echo "Repo name required." 1>&2 && exit 1 | |
curl -H "Content-Type:application/json" https://gitlab.com/api/v3/projects?private_token=$token -d "{ \"name\": \"$repo_name\" }" | |
git remote add origin "git@gitlab.com:hedefalk/$repo_name.git" | |
git push --set-upstream origin master |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Courtesy of https://coderwall.com/p/r7yh6g/create-a-new-gitlab-repo-from-the-command-line, just put my access token in pass: https://www.passwordstore.org/
Since git do magic with git-*, you can do
git init-gitlab