STEP 04 OF 13
×Staging & Committing Changes
This three-step rhythm — edit, stage, commit — is the heartbeat of working with Git. You'll repeat it constantly.
The staging area
Before a change becomes part of your history, it sits in a 'staging area.' This lets you choose exactly which edits go into the next commit, instead of saving everything at once.
Writing a commit
A commit is a permanent snapshot of your staged changes, saved with a message describing what changed and why. Good commit messages make project history easy to read later.
Reviewing history
Every commit you make is stored permanently and can be viewed at any time, giving you a complete timeline of how the project evolved.
>_ COMMANDS YOU'LL USE
git add filename.txtStage a specific file for the next commitgit add .Stage all changed files in the current foldergit commit -m "Add login page"Save staged changes with a descriptive messagegit logView the history of commits in this repository💡Write commit messages in the present tense, like instructions: "Fix navbar bug" rather than "Fixed navbar bug."
⚠️Common mistake: Vague commit messages