1. Repo Setup

Create New Repo Directory, then Initialize Repo

mkdir <project-name>
cd <project-name>
$ git init

Or, Clone Existing Repo

$ git clone repo-url.git

2. Starting Collaboration

See Available Branches, then Switch to Targeted Branch

$ git branch
$ git checkout <branch-name>

Or, Create and Switch to New Branch

$ git checkout -b <branch-name>

3. Continuing Collaboration

A day or more may pass by. When you come back to continue collaboration with others, make sure to always pull remote updates before adding new changes.

Update Local Branch from Remote Branch (if any)

$ git pull origin <branch-name>

Modify files or create new ones

touch README.md

Check Repo Status

$ git status

Add File(s)

$ git add filename
$ git add .

Discard unstaged changes

$ git restore path/to/file/to/revert
resp.
$ git restore .

Commit changes with a message

$ git commit -m "add readme file"

Pull Updates from Remote Branch

$ git pull origin <branch-name>

Push the Updated New Branch

$ git push origin <branch-name>