I recently released a private repository but while releasing I made the mistake of releasing it using develop branch as target branch. Now i want that release to target master branch and not develop.
How to change the target branch to master?
Note: When i do edit, the option to change target branch appears for a second and then disappears.
Do i need to create a new branch for this?
I agree with @parsenz that there is no way to do this on GitHub (as of Enterprise v2.1). You will have to delete and recreate. I'm no git expert but here are the steps I followed to "move" a release from one branch to another on GitHub:
In GitHub (web UI):
Then in git bash:
git push --delete origin <tag_name> // deletes remote tag
git tag -d <tag_name> // deletes local tag
git checkout <commit_hash>
git tag <tag_name>
git push origin <tag_name>
git checkout <branch_name>
(to go back to your previous branch) Back in GitHub:
Note: this normally happens because the release was created against the wrong branch. You can set a default branch for a GitHub repository in the repository settings (tools icon in the right tabs navigation).
I don't think you can on Github. You have to delete the release and recreate it. I solved this by entering the following in my console:
git push origin :refs/tags/{old_tag_name}
And then recreate the release
git pull --tags # Get all releases
commit=$(git rev-parse my-awesome-branch) # Get commit hash
echo $commit > .git/refs/tags/my-awesome-tag # Change target commit
git push --tags --force # Update tags on GitHub
Here my-awesome-branch
and my-awesome-tag
are the branch you want to target and tag you want to update respectively
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.