Tsallaka zuwa abun ciki
Justice Tech School

Commit Tracked Changes in One Step

git commit -a stages all modified tracked files before committing. It never adds new untracked files.

Example
echo one > a.txt && git add a.txt && git commit -qm 'first'
echo two >> a.txt
echo new > n.txt
git commit -qam 'Update a'
git status --short

Result

?? n.txt

Exercise

Include tracked changes.

git commit -m "msg"

Quiz Test

Does -a add new files?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.