Git cheatsheet

From Applied Optics Wiki
Jump to: navigation, search


To start GIT for the first time

Issue this in the root directory of the project

git init


Adding files to the repo

Note this doesn't protect them yet but just lets GIT know you want to protect them

git add <list of files I want>
git commit -m "my notes on the day"

Committing files (ie protecting them)

git add <files I want tracked>
git commit -m "more messages"

or to commit all files previous added

git commit -a -m "more messages"