Initial upload of local code to repo on github

Another quick note to self ‘cos this is something that I can never remember.

After creating a local repo with the project being developed, we need to create the repo at https://github.com/slugbucket and then run the following commands on teh local workstation.

$ git push --set-upstream https://github.com/slugbucket/automation-demo-packages.git master
$ git remote add origin https://github.com/slugbucket/automation-demo-packages.git
$ git push -u origin master

Enter the github username and password when prompted.

If the repository on github was created with an initial README.md file, it will first be necessary to do a merge with the following command,

$ git pull https://github.com/slugbucket/automation-demo-packages.git

Then the push commands above will wok fine.

Advertisements

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