Staging & Commit
This is the core Git workflow you'll use every day. We've set up a project with two files for you to practice with.
The Workflow
✏️
Make changes
Edit files
↓
📦
Stage
Select changes
↓
✅
Commit
Save a snapshot
↓
🔁
Repeat
Small, steady steps
Practice: Stage and Commit
Use the Terminal below to run commands and watch the VS Code view update in real time.
Steps
1
Check Current Status
See what Git knows about your files.
First, check the status of your repo:
git statusYou will see two untracked files. Git sees them but is not tracking changes yet.
In VS Code
Look at the Source Control panel. You will see files marked with U (Untracked).
2
Stage a File
Choose what will go into your next commit.
3
Create a Commit
Save a snapshot with a clear message.
4
View Your History
See your commit in the log.
💻 Terminal
Terminal — /
Repository initialized with sample files.
Try: git status
$
📝 VS Code
Explorer
No files yet.
Click + to create a file.
Click + to create a file.
Select a file to edit
Terminal vs VS Code Commands
| Action | Terminal | VS Code |
|---|---|---|
| Check status | git status | Source Control panel shows changes |
| Stage one file | git add filename | Click + next to file |
| Stage all files | git add . | Click + at top of Changes |
| Commit | git commit -m "msg" | Type message + click checkmark |
| View history | git log | Git Graph extension |
Pro Tips
- • Commit often - small, frequent commits are easier to understand and undo.
- • Write good messages - be specific about what changed and why.
- • Stage selectively - you do not have to commit everything at once.
- • Check status often - it is your best friend for staying oriented.
- • Flags -
-mmeans message. - • Status letters -
U= Untracked,M= Modified,A= Added,D= Deleted.