'Appropriate Method for making a bugfix to older version tags of a repo

The latest version of my project is tagged on github as 1.11.0. I need to fix a bug that affects versions 1.10.0 1.9.0 1.8.0 and 1.7.0 The master branch is tagged as 1.11.0. What's the best way to fix the bug across all the older versions? People use older versions of my repo so I can't deprecate support for any version. If I checkout the tagged repos, change them and make a new commit I get the message:

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

This seems incorrect. I feel that there is a better way to fix a bug in each of these versions and release 1.11.1 1.9.1 1.8.1 1.7.1 but I'm not sure how to do it besides the way I described above. I've tried creating a new branch based off a tag but then github wants me to merge my changes to master which I feel is incorrect. How should I proceed in this situation?



Solution 1:[1]

A tag is a static pointer to a specific commit. If you want to maintain multiple versions of your library/software on GitHub, you'll need maintenance branches as well as the tags.

For example, see the 6-0-stable branch on the Ruby on Rails GitHub repository. The tag for the most recent patch of Rails 6.0 is 6.0.5, which is currently one commit behind the HEAD of the 6-0-stable branch.

In your case, you'll need to create a new branch at each of those tags; e.g., 1-10, 1-9, etc. Then, you can merge or cherry-pick your patch to each of those branches individually, and tag the new HEAD of the branch with the patch number.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1