Search code examples
gitgithubissue-tracking

How to delete a remote commit?


I made some commit and pushed them to a Github repo. Then I decide to discard those, using git reset --hard and git push origin --force to override the original commits.

But it seems they are not disappearing in issue page (those commit mentioned the same issue), still being referenced on issue page, making that page messy, they do invisible in commit log though.

How to delete them thoroughly?

update

the process are as below:

on my current branch, latest commit
make some change
git add .
git commit -m "made some changes" -m "and mentions the issue #123
git push

a new commit shows on github, a1b2c3,
now the issue #123 page, shows an activity "this issue is mentioned by a1b2c3".

I don't want this commit for some reason.
git reset --hard HEAD^
make some change again
git commit -m "made new changes" -m "still mentioning issue #123"
git push --force

This new commit, d4e5f6, take place of commit a1b2c3, and a1b2c3 are invisible in the repo.

But on the issue page, there are two activities,
"this issue is mentioned by a1b2c3"
"this issue is mentioned by d4e5f6"
and you can actually see the commit a1b2c3 which was previously discarded.

What I want is a clean issue page (and other people, too, it was me fucked up).


Solution

  • Issues is a github application,not git. github provide git remote repo and other features.

    I guess you wang to completely remove an issue.But unfortunately, the github API only allows you to open/close/reopen issues.

    you can look at api docs