Skip to content
techsnow

Git Basics

init, add and commit

Syntax:

git init                     # start tracking this folder (once per project)
git add index.html           # stage one file
git add .                    # stage every change
git commit -m "Add home page"

Writing good commit messages

  • Use the present tense and imperative mood: "Add login form", not "added stuff".
  • Keep the first line under about 50 characters.
  • Describe what and why, not how.
  • Make small commits that each do one thing.