GitHub Basics

by Scott, Revised on October 2, 2017 (PerlOpen SourceWeb Development)

A helpful GitHub tutorial:

Create a repo on Github, then connect your local repo to Github.

Create a directory, cd into it and initialize a repo. A .git directory is created. A .gitignore file can be created as well to prevent tracking of certain files.

git init

Add/develop your project (repeat commands as needed).

git status
git add .
git commit -m 'description'

Connect your local repo to the Github repo.

git remote add origin

Push/pull as needed.

git push origin master
git pull origin master

Clone a repo.

git clone

If there are multiple accounts to github on same machine, create separate ssh keys, and create a ssh config file (~.ssh/config). I have found that they both need a different "Host" value then the default of If one is left as, then that one is used exclusively.

#work account
    User git
    IdentityFile ~/.ssh/

#my account
Host github.mine
    User git
    IdentityFile ~/.ssh/github.mine

And use:

git remote add origin git@github.mine:username/Repo-Name.git

Tags: PerlOpen SourceWeb Development