All code lines exist in one of three states.
Modified code stays in your local copy unless staged and committed.
Open Git BASH (Windows) or terminal (mac/linux) and add your name and email:
git config --global user.name "Jason Jensen"
git config --global user.email jason.jensen@statcan.gc.ca
Note: email should match GitHub email.
mkdir team-awesomes-CANDEV-project
cd team-awesomes-CANDEV-project
Errors may result if SSH was not configured correctly.
Using Git BASH (windows) or terminal (mac/linux) in the repository folder:
git status
git add .
Note: files can also be added one at a time.
Note: use a .gitignore file to exclude groups of files/folders.
git status
git commit -m "add submission files"
git push origin main
Situation: repo is set up with a README.md file.
git status
git diff README.md
git add README.md
git status
git commit -m "change readme"
git push origin main
git status
Note: no characters before the filetype extension (before the period)
git status
Example .gitignore files: https://github.com/github/gitignore
Jacob Fiksel: Introduction to Git and GitHub
Munira Omar: An Intro to Git and GitHub for Beginners Part I (Tutorial)