Git

Creating a repo

mkdir ~/Hello-World
Creates a directory for your project called "Hello-World" in your user directory
git init
Sets up the necessary Git files
touch README
Creates a file called "README" in your Hello-World directory

Commiting

git add README
Stages your README file, adding it to the list of files to be committed.
git commit -m 'first commit'
Commits your files, adding the message "first commit"

Push your commit

git remote add origin https://github.com/username/Hello-World.git
Creates a remote named "origin" pointing at your GitHub repo.
git push origin master
Sends your commits in the "master" branch to GitHub.

Forks, Cloning, and Remotes

git clone https://github.com/username/Spoon-Knife.git
Clones your fork of the repo into the current directory in terminal

When a repo is cloned, it has a default remote called origin that points to your fork on GitHub, not the original repo it was forked from. To keep track of the original repo, you need to add another remote named upstream:

cd Spoon-Knife
Changes the active directory in the prompt to the newly cloned "Spoon-Knife" directory
git remote add upstream https://github.com/octocat/Spoon-Knife.git
Assigns the original repo to a remote called "upstream"
git fetch upstream
Pulls in changes not present in your local repository, without modifying your files

Adapted from the Github Help Docs