Getting a Git repository

https://git-scm.com/book/en/v2/Git-Basics-Getting-a-Git-Repository

You typically obtain a Git repository in one of two ways:

  1. You can take a local directory that is currently not under version control, and turn it into a Git repository, or
  2. You can clone an existing Git repository from elsewhere.

Initialize a repo to be tracked by git

git init

Cloning an Existing Repository

git clone <url> <directory>

Recording Changes to a Git Repository

https://git-scm.com/book/en/v2/images/lifecycle.png

https://git-scm.com/book/en/v2/images/lifecycle.png

Checking status of the git repo

git status

# for a short status use the -s option
git status -s

Tracking changes i.e. adding changes to staging area

git add <filename>

Ignoring files i.e. files to not be tracked

To ignore files you want to use a .gitignore file

touch .gitignore

# add files and directories that you don't want to track such as 
# large log files or data
echo bigdata.csv >> .gitignore