Setting up your user

git config --global "Your name here"
git config --global ""
add your ssh key (in ~/.ssh/ to your github account
ssh -T

credit to kbroman

Setting up a new repository

Create an empty repository on github and clone it using the git address specified near the top of the page

git cloneĀ 
cd new_repo
git commit -m "First Commit!"

git push -u origin master

credit to kbroman

Setting up a .gitignore file

vim .gitignore
git rm -r --cached .
git add .
git commit -m "Added .gitignore"
git push

I had issues with this in powershell for some reason, using the Windows Subsystem for Linux worked like a charm though.

To make a new commit

git add .
git commit -m "next commit"
git push

I also highly recommend using git status before creating a new commit to check that everything is working correctly.