BoltzmannBrain
BoltzmannBrain

Reputation: 5412

Updating github repo release with a pull request

I'm about to merge some changes (from my local branch foo_changes, where the last commit is 0x42abc) to a Github repo's master branch and would like to also increase the release number from 0.2.1 to 0.2.2. How can I do this? That is, I want the repo's release page to show the latest release is 0.2.2 with commit 0x42abc.

Here is my git remote -v:

origin  [email protected]:repo_name/repo.git (fetch)
origin  [email protected]:my_name/repo.git (push)
upstream    [email protected]:repo_name/repo.git (fetch)
upstream    [email protected]:repo_name/repo.git (push)

For the commits I want to merge in I did git push origin foo_changes.

Upvotes: 1

Views: 1357

Answers (1)

Maximillian Laumeister
Maximillian Laumeister

Reputation: 20399

GitHub source code releases are based off of Git tags, so to get a GitHub "release" to show up, you will need to tag a commit, then push the tag. Then from the GitHub interface you can "draft a new release", and you can add binaries and/or a long description to it too if you wish.

So for instance to create release v0.2.2 of your software based on the latest commit of the current branch, you would do something similar to the following commands:

git tag -a v0.2.2 -m 'added a new release'

git push origin --tags

Then from the GitHub interface, click "Releases" and then click "Draft a new release". Then select the tag that you pushed.

If I'm not mistaken, you would then be able to do the pull request based on that branch, and the tag would come along.

For more information on tagging, check out this article on Git tagging. For more information on GitHub releases, check out this short article on creating GitHub releases.

Upvotes: 1

Related Questions