Created
January 9, 2018 16:38
-
-
Save gullz/64c03c2fe68be97e42bb1cfedd2e578c to your computer and use it in GitHub Desktop.
Creating a git repository from command line - Linux
This file contains hidden or 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/bash | |
# -------------------------------------------------------------------------- # | |
# This is a linux shell script, used to create 'github' repository from | |
# command line. | |
# Each git server providers provide different APIs for creating repositories | |
# though, the repository manipulation through git client is same. | |
# Note: This can be done in windows also but requires curl. | |
# --------------------------------------------------------------------------- # | |
# From: https://stackoverflow.com/questions/2423777/is-it-possible-to-create-a-remote-repo-on-github-from-the-cli-without-opening-br | |
curl -u 'USER.NAME' https://api.github.com/user/repos -d ' | |
{ | |
"name": "Hello-World", | |
"description": "This is your first repository", | |
"homepage": "https://github.com", | |
"private": false, | |
"has_issues": true, | |
"has_projects": true, | |
"has_wiki": true | |
}' | |
# Note: note that the 14th line contain an apostrope(') at the end of the line, | |
# and USER.NAME should be your github user name. | |
# More information can be found from https://developer.github.com/v3/repos/#create |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment