Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>This can be done with three commands:</p> <pre><code>curl -u 'nyeates' https://api.github.com/user/repos -d '{"name":"projectname","description":"This project is a test"}' git remote add origin git@github.com:nyeates/projectname.git git push origin master </code></pre> <p>(updated for v3 Github API)</p> <p><br/></p> <h1>Explanation of these commands...</h1> <h2>Create github repo</h2> <pre><code> curl -u 'nyeates' https://api.github.com/user/repos -d '{"name":"projectname","description":"This project is a test"}' </code></pre> <ul> <li>curl is a unix command (above works on mac too) that retrieves and interacts with URLs. It is commonly already installed.</li> <li>"-u" is a curl parameter that specifies the user name and password to use for server authentication. <ul> <li>If you just give the user name (as shown in example above) curl will prompt for a password.</li> <li>If you do not want to have to type in the password, see githubs api documentation on <a href="https://developer.github.com/v3/#authentication" rel="noreferrer">Authentication</a></li> </ul></li> <li>"-d" is a curl parameter that allows you to send POST data with the request <ul> <li>You are sending POST data in githubs <a href="https://developer.github.com/v3/repos/#create" rel="noreferrer">defined API format</a></li> </ul></li> <li>"name" is the only POST data required; I like to also include "description"</li> <li>I found that it was good to quote all POST data with single quotes ' '</li> </ul> <h2>Define where to push to</h2> <pre><code>git remote add origin git@github.com:nyeates/projectname.git </code></pre> <ul> <li>add definition for location and existance of connected (remote) repo on github</li> <li>"origin" is a default name used by git for where the source came from <ul> <li>technically didnt come from github, but now the github repo will be the source of record</li> </ul></li> <li>"git@github.com:nyeates" is a ssh connection that assumes you have already setup a trusted ssh keypair with github.</li> </ul> <h2>Push local repo to github</h2> <pre><code>git push origin master </code></pre> <ul> <li>push to the origin remote (github) from the master local branch</li> </ul>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload