Renaming and Moving
git mv renames and stages. Git sees renames from content.
Example
echo one > a.txt && git add a.txt && git commit -qm 'first'
mkdir src
git mv a.txt src/main.txt
git status -s
git commit -qm 'Move file'
git log --format=%s -n 1Result
R a.txt -> src/main.txt Move file
Exercise
Rename.
git old new
Quiz Test
These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.