Git basics

Set your email, username and password

git config --global user.name "Your Name"
git config --global user.email "you@example.com"

For all the following commands, make sure you are in the directory where you want to create the repository.

Create a new git repository

git init

Add a single file to the staging area

git add FILENAME

Add all files to the staging area

git add .

Commit the files in the staging area

git commit -m "Your message goes here"

Push your commits to Github

git push origin master

Pull any commits from Github

git pull


You might also find this git cheatsheet from Github useful.



Need help? Email me: alex@dunae.ca