Staging and Committing
Edit files, stage chosen changes with git add, then record them with git commit -m. The staging area lets you build a commit from selected changes. git status -s gives a short summary.
Example
echo "Hello" > hello.txt
git status -s
git add hello.txt
git status -s
git commit -q -m "Add hello"
git status -s
git log --format=%sResult
?? hello.txt A hello.txt Add hello
Exercise
Stage every change.
git .
Quiz Test
These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.