Intro to Git & Github

What is GIT?

  • Distributed Version Control System
  • Local and Remote

Installing GIT locally

Install Instructions

  • Configure name/email
    git config — global (FirstName LastName)
    git config — global (Your email)
    git config — global color.ui auto

Initializing a Repo

(Repo: folder you want to have git track)

  • or create a new folder : mkdir (folder name)
    create a new file : touch (file name) (ex: touch
  • Then initialize the repo
    git init
  • If you need to remove git tracking, running rm -rf.git
    Be careful with the rm terminal command as it will permanently delete files/folders specified — you will not find them in the trash.

Staging area and committing

  • add files/folders to the STAGING area
    git add
    git add folder-name/
    git add -A OR git add .
    git reset (removes README from staging area)
  • Commit changes in STAGING area
    git commit -m “add like button to profile photos”
    If you don’t include the -m and message, you will enter Vim (or your default text editor) which we will not cover here today


git branch
git branch new-feature
git checkout new-feature

Pulling/Pushing to Remote

git pull origin main

  • This accomplishes both a fetch and a merge

Other helpful Remote Commands

git clone (url)


you don’t use them if you use Github. If you want to merge locally you can use below commands.

Helpful commands

git help git -> overview of git in general
git help (command) (git help commit)
git (command) — help (git commit — help)

Graduate student of CS, My study notes for programming