← Git & GitHub
// lesson 4 of 9
Staging and committing
Save snapshots of your work with add and commit.
// 1. read the lesson
Saving in Git happens in two steps. First you choose which changes to include (staging). Then you save them as a snapshot (committing). Think of staging as putting items in a box and committing as sealing and labelling the box.
git add index.html git commit -m "Add home page"
Use git add . to stage every change in the folder. Write commit messages that finish the sentence 'This commit will…', for example 'Add contact form' or 'Fix broken nav link'.
See your history at any time with:
git log --oneline
Written by the LEARN team.
Sign in to take the lesson test.
Your answers and code are checked and saved to your account.
Sign in