Home > version control > Creating github repositories with command line

Creating github repositories with command line

Just thought I’d share a small post on creating github repositories using the command line.

If you want to create a repository through the commandline (CLI), you can use the following command from the GIT bash :

github logo

Davy@DAVY-PC ~
$ curl -F 'login=ddewaele' -F 'token=qdqdqsdqsqsdYOURTOKENqsdsqdqsd' https://
github.com/api/v2/yaml/repos/create -F 'name=OAuthCommandLine'
---
repository:
  :has_wiki: true
  : open_issues: 0
  :forks: 1
  :fork: false
  :has_issues: true
  :watchers: 1
  :private: false
  :created_at: !timestamp
    at: "2010-11-10 12:40:42.936040 -08:00"
    "@marshal_with_utc_coercion": false
  :name: OAuthCommandLine
  :url: https://github.com/ddewaele/OAuthCommandLine
  : owner: ddewaele
  :has_downloads: true

Davy@DAVY-PC ~
$

Your API key can be found in your account settings :

github account settings

github account settings

Your github repository will be created immediately

github repo

github repo

Once the repository has been created, you can checkin your local git project using the following commands :


$ cd /c/PROJECTS/Android/OAuthCommandLine/
Davy@DAVY-PC /c/PROJECTS/Android/OAuthCommandLine (master)
$ git remote add origin git@github.com:ddewaele/OAuthCommandLine.git
Davy@DAVY-PC /c/PROJECTS/Android/OAuthCommandLine (master)
$ git push origin master
Enter passphrase for key '/c/Users/Davy/.ssh/id_rsa':
Counting objects: 56, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (41/41), done.
Writing objects: 100% (56/56), 28.42 KiB, done.
Total 56 (delta 14), reused 0 (delta 0)
To git@github.com:ddewaele/OAuthCommandLine.git
 * [new branch]      master -> master
Bookmark and Share
  1. December 25th, 2010 at 15:51 | #1

    Thanks a lot for that extremely cool post.

  2. February 22nd, 2012 at 17:39 | #2

    Dude, Awesome,. The Best Tutorial I have ever come Across,
    I have tried atleast 10 – 15 Sites For uploading Project to GitHub…
    Keep Rocking….

  1. No trackbacks yet.