gitgithuborphaned-objects

How to assign a tag to the orphaned commit in GitHub?


I have an orphaned commit produced by another person, and I see it in GitHub GUI. This commit is not accessible by cloning the repository as there are no branches/tags that contain this commit on the path. Assuming that the author of the commit has removed his local repository, I wish to assign a branch/tag to this commit directly in GitHub.

This commit can be seen just using a direct link that I can use because it's git hash is known. The commit is not seen in the Insights>Network however.

How can I assign a tag to the commit from this commit page in GitHub? Is that possible to create a new branch directly from this page? What are other ways to return this commit back in service?


Solution

  • Making an orphan commit cloneable again

    Orphan commits that reside only on the remote (as long as garbage collection allows) cannot be cloned.

    Through the Github web interface, using a direct link (e.g. https://github.com/<user>/<repository>/tree/<orphan-commit>) to the tree object connected to an orphan commit, you can access the Create Branch interface to create a new branch based on <orphan-commit> (which you already know the hash of) and make the object cloneable again.

    enter image description here