I have a hotfix that needs to be applied to a already released code. I can get to the master of release but when I try to merge the branch, GitHub automatically changes the default branch to master. I am not sure how to do it from GitHub UI. Can someone help?
What I am trying to do:
First, you do not want to add them to the Test12 release, you want to create a new release. Once you release code you shouldn't change it, because that will create a situation in which you have different code in the wild under the same name, which will just create confusion. If Test12 becomes totally irrelevant after you release the next one, and you don't want people to use it (totally broken, security vulnerability, etc), you can just delete the release.
From your text it sounds like you have only one branch, master
.
A quick solution to get your fix released could be:
git checkout -b hotfix-branch 1
master
with git cherry-pick <commit of hotfix>
git tag -a 1.0.1 -m "Hotfix for issue..."
Workflow notes:
I noticed your version is only a single number. You should check out semantic versioning, the most commonly used three-decimal version system that uses each number to convey specific meaning, largely backwards-compatibility.
If my guess was correct and you only have one branch, you should also check out git flow, the most commonly-used workflow for making doing things like release hotfixes easy.