gitpractice.dev

brewly — Ch.8 · Ship a hotfix

Exercise 4 of 5

Before you start

The hotfix routine

Fix on the release branch (press "Write the code"), commit, and tag the new patch version.

--follow-tags pushes your commits together with their annotated tags.

Then copy the fix to main with cherry-pick, so the bug does not return in the next release. -x notes where the commit came from.

git commit -am "What you fixed"
commit the fix
git tag -a <version> -m "message"
tag the patch release
git push --follow-tags
push the commits and their tags
git switch main
go to main
git cherry-pick -x <branch>
copy the newest commit of that branch
git push
publish main
You can reopen this any time with “Lesson”.

Continue on a desktop

Typing git on a small screen is no fun. Open this page on a laptop or desktop to practise.

Back to the path