Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change a release on Github point to the latest commit?

Tags:

git

github

I recently released a new version of my project on Github by clicking the release button, on the right-hand side of the page. However, I found something error in my code, so, I just fixed and committed it.

Now, I would like to change my latest release in order to include my latest commit. I tried to remove the release and recreate it once again using the same tag name, however, it still points to the previous commit. I have been googling but still no luck. Any help would be appreciated.

like image 696
lvarayut Avatar asked May 10 '15 14:05

lvarayut


People also ask

How do I mark a commit as release?

Use tags (lightweight or annotated, though generally for releases an annotated tag is better since you can store extra release data and/or GPG-sign it). You can create tags without any switching and merging. If you're talking about GitHub, you can create releases from a specific commit using the UI.

What is the difference between release and tag in GitHub?

A tag is a git concept whereas a Release is GitHub higher level concept. As stated in the official announcement post from the GitHub blog: "Releases are first-class objects with changelogs and binary assets that present a full project history beyond Git artifacts."


1 Answers

You would need to update/move the tag locally first, and force push it (as in here):

# assuming you are in the branch referencing currently the right new commit:
git tag -f <tagname>

# push your new commit:
git push 

# force push your moved tag:
git push origin -f <tagname>

Then you can go on GitHub and associate new binaries with the release for that tag (which should point to the right commit).

like image 50
VonC Avatar answered Oct 05 '22 19:10

VonC