Switching Branches
git switch moves between branches and updates your files.
Example
echo one > a.txt && git add a.txt && git commit -qm 'first'
git switch -q -c dev
echo dev > d.txt && git add d.txt && git commit -qm 'dev work'
git switch -q main
ls
git switch -q dev
lsResult
a.txt a.txt d.txt
Exercise
Go to main.
git switch Quiz Test
These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.