Idiot's guide to github

Screenshot from 2014-02-20 22:13:47I’ve been finding it difficult to get my head around github.

As is often the case in the end I found it easiest to do so through the command line.

I’d already created a repository which holds my firefox ‘New tab’ and home page

To amend it I did the following. I think.

Set up my githubcredentials:

git config --global user.name mattypenny
git config --global user.email mattypenny@gmail.com
git config --global credential.helper 'cache --timeout=36000'

Clone the repository locally

git clone https://github.com/mattypenny/start_page.git

This creates a folder with all the repository files in it locally

cd start_page

Then I made all my changes to the start page.

Then I did a local commit:

git commit -m 'New pics and added in all the picture credits'

This shows that git was pointing to the github repository as ‘origin’. This seems to have been retained from the clone command.

$ git remote -v
origin	https://github.com/mattypenny/start_page.git (fetch)
origin	https://github.com/mattypenny/start_page.git (push)

Then I pushed it all back to github

$ git push origin master
Username for 'https://github.com': mattypenny
Password for 'https://mattypenny@github.com':
Counting objects: 17, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (11/11), done.
Writing objects: 100% (11/11), 1.05 MiB | 172 KiB/s, done.
Total 11 (delta 1), reused 0 (delta 0)
To https://github.com/mattypenny/start_page.git
   9f6e3d5..40431e1  master -> master
Advertisements