Creating a Remote GitHub repository from Command Line

This is very simple, but a great tool to use.

Just create a shell script with this content.

#!/bin/sh

repo_name=$1

test -z $repo_name && echo “Repo name required.” 1>&2 && exit 1

curl -u ‘your_github_username’ https://api.github.com/user/repos -d “{\”name\”:\”$repo_name\”}”

Now simply execute the shell script.  You may need to run this line first.  

chmod +x git-create

Then run the script by going to the folder that contains the shell script file and typing this in.  Here’s an example.

sh git-create.sh Name of app.

Check out this post here for more information.

This post is mainly here for myself so that I don’t forget this.

Advertisements

About adeiji

I love to create anything and everything. It's my passion. I love to teach myself and others as well.
This entry was posted in Uncategorized and tagged , , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s