Last active
May 13, 2016 13:54
-
-
Save faroit/013613f5f3faf2e0876c56a308d0663b to your computer and use it in GitHub Desktop.
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
USER=your_github_username | |
# Create a token via commandline | |
# curl -u "$USER" -d '{"scopes":["repo"],"note":"migrate.sh"}' https://api.github.com/authorizations | |
TOKEN=yourtoken | |
REPONAME=${PWD##*/} | |
# Create repository and return the git url | |
URL=$( curl -v -XPOST -H "Authorization: token $TOKEN" https://api.github.com/user/repos \ | |
-d "{ \"name\": \"$REPONAME\", \"private\": true }" | jq '.ssh_url' | sed 's/\"//g' ) | |
echo "$URL" | |
# add remote 'gh' to repo | |
git remote add gh "$URL" | |
git push gh --all | |
git push gh --tags |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment