GitHub patch release previous version

David Carr

On Github you way from time to time need to patch release the previous version of a published release. 

This took me longer than I care to admit to understand the steps involved. Hence I'm documenting them in this post.

Step 1: Check out the branch corresponding to the previous version of your code.

git checkout 7.3.0

Step 2: Fix the bug in the code.

Let's say it's a breaking change that's been fixed in the code.

Step 3: Commit the changes with a version number that indicates the patch release.

Commit the fix

git commit -m "Fix bug in 7.3.0"

Next, create a new tag

git tag 7.4.0

Step 4: Push the changes to the remote repository.

git push origin 7.4.0

Step 5: Create a new release for the patch version on GitHub.

Navigate to the main page of the repository on GitHub.com, click on the Releases tab, and then click on the "Draft a new release" button.

Step 6: Fill in the details for the release in the form, select the tag created from Step 3, and fill in the release notes.

Once you have filled in the details, click on the "Publish release" button to publish the release.

Fathom Analytics $10 discount on your first invoice using this link

Help support the blog so that I can continue creating new content!

Sponsor

Fathom Analytics $10 discount on your first invoice using this link

Subscribe to my newsletter

Subscribe and get my books and product announcements.

© 2006 - 2024 DC Blog. All code MIT license. All rights reserved.