GitHub Source view displays commit that no longer exists

I rewrote the history of the GitHub repository two weeks ago (rebase and some cherry picks), and the force pushed it back to GitHub via

git push -f origin master 

Everything went fine, at least it looked like this, and git log showed the correct commit history. I know that rewriting history is bad practice, but the repository is new and I am the only user, so there should not be any problems for others.

My repository has only one branch named master .

Now to my problem. My repository's GitHub Source view displays at least one message that should no longer exist due to my rewriting of history. And indeed, this does not exist in my local or GitHub commit log (but it is part of my local reflog). How can I get rid of this commit and possibly others that are in my remote GitHub repository? Is there a way to clear the remote repository and delete those “unreachable” commits that are not part of the commit log?

By the way, if I clone a GitHub repository, the scammer is not present in the clone. git show <SHA1> returns fatal: bad object .

My question is very similar to SO 4367977 , but the solution to this question, “awaiting GitHub garbage collection”, obviously does not work. Link commits still work after 6 months.

Removing the repository and re-creating it should solve the problem, but it's not very elegant.

Thanks in advance!

+4
source share
1 answer

Entries do not disappear disappear from the repository due to rewriting of the history, they simply do not refer anymore.

Clicking on the repository means loading a list of objects, and then setting some tags and branches for some commit. This does not mean deleting any commits (and other objects) from the target repository that are not used by branches as of now.

As you noted by cloning, commit is no longer available. Theoretically, it should be garbage collection in the long run, but as you noticed, this may not happen in the near future - perhaps never. (Could it be that someone has separated from the obligation mentioned in another question that you linked, and this interferes with garbage collection?)

If there is any sensitive data in the “wrong” commit, contact github support to delete it. If not, just ignore the commit - it won’t hurt sitting there in the repository.

0
source

All Articles