Tsallaka zuwa abun ciki
Justice Tech School

Amending the Last Commit

git commit --amend changes the last commit message or adds forgotten files. Do not amend commits you already pushed.

Example
echo one > a.txt && git add a.txt && git commit -qm 'first'
git commit --amend -qm 'First commit (fixed)'
git log --format=%s

Result

First commit (fixed)

Exercise

Change last commit.

git commit  -m "new"

Quiz Test

When avoid --amend?

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