← Branching & Merging
Commit on the branch
Learn
Commit on the branch
Commits go onto whichever branch you're on. Create a file, stage it, commit it, and the new
commit belongs to your branch alone; main hasn't moved.
echo "hello" > notes.txt
git add notes.txt
git commit -q -m "Add notes"
git log --oneline
git log shows the branch's history: your new commit on top of the commit it started
from. The terminal continues from the previous mini lesson, so you're already on your
branch.
Your task
On the feature branch, create a feature.txt file, stage and commit it with the message Add feature, then git log --oneline to see both commits.