Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change connected commit on release github

How you I change the connected commit on a github release? Release

I want to change it to an earlier commit, because I created the release afterwards (after some commits to release 0.9)

like image 587
Zoker Avatar asked Jul 20 '14 10:07

Zoker


People also ask

Can I edit a release GitHub?

Editing a releaseOn GitHub.com, navigate to the main page of the repository. To the right of the list of files, click Releases. On the right side of the page, next to the release you want to edit, click . Edit the details for the release in the form, then click Update release.

Can I change pushed commit?

Changing the latest Git commit message If the message to be changed is for the latest commit to the repository, then the following commands are to be executed: git commit --amend -m "New message" git push --force repository-name branch-name.

How do you create a release from a commit?

Click on the “Browse files” button (https://github.com/xxx/yyy/tree/zzz) Create a branch on this commit by hitting the “Tree” drop down, try to find an unexisting branch name, and create it. Go on the release creation form, and instead of looking into the “recent commits”, find your freshly created branch.


1 Answers

When you consider the GitHub API for creating a release, you see a release needs:

  • a tag
  • a commit referenced by that tag

So you need to move your tag (locally first, then push it to your GitHub repo)

git tag -f -a <tagname> [<commit> | <object>] git push -f <reponame> refs/tags/<tagname> 

Then see if that is enough for the release to be updated.
(See "How do you push a tag to a remote repository using Git?")

If not, you might have to delete that release, and recreate it on the same tag (which will refer to the new commit)

like image 91
VonC Avatar answered Sep 22 '22 19:09

VonC