Stage 2 · Lesson 2 of 8
status, add, diff and commit
Git snapshots of your project called . You will run the same hundreds of times. git status shows what changed.
git diff shows the changes line by line. git add puts the changes you choose into the , a waiting room for the next commit. git commit -m "message" saves that snapshot.
The staging area exists so that one commit holds one logical change, even when you edited several things; git add -p lets you stage just parts of a file. Commit small and often. Write that say why, such as "Reject negative amounts in budget input", rather than "fix".
git log --oneline shows the history. Run git status before and after every command until it is a habit.
A question to check yourself, an AI practice session and 3 cheat sheet entries come when you add the roadmap to your account. Add it
Resources for this stage
Start with· follow one of these
- CourseFreeThe Missing Semester of Your CS Education
MIT · Beginner
MIT lectures on dev tools; the shell, shell tools and version control lectures are enough
- GitHub repoFreeGitHub Skills: Introduction to GitHub
GitHub · Beginner
Free one-hour exercise: branch, commit, open and merge a pull request