Now that you have a local repository, let's learn how to make changes and save them as commits. Each commit is a checkpoint you can return to later.
Check Repository Status
First, see what's changed in your repository:
Terminal
git statusThis shows modified files, new files, and files ready to commit.
Stage Your Changes
Before committing, you need to "stage" the changes you want to include:
Terminal
# Stage a specific file
git add filename.txt
# Stage all changed files
git add .Create a Commit
Now save your staged changes with a descriptive message:
Terminal
git commit -m "Add new button styles to navigation"Writing Good Commit Messages
Good commit messages describe WHAT changed and WHY. Start with a verb: "Add", "Fix", "Update", "Remove". Keep the first line under 50 characters.
Push to GitHub
Upload your commits to GitHub so others can see them:
Terminal
git pushLesson Complete!
- Check status with git status
- Stage changes with git add
- Commit with git commit -m
- Push to GitHub with git push
You can now track and share your changes!
The patterns behind this lesson
Collaborative AIEnable effective collaboration between multiple users and AI within shared workflows.Contextual AssistanceOffer timely, proactive help and suggestions based on user context, history, and needs.Error Recovery & Graceful DegradationFail gracefully with clear recovery paths when things go wrong.