Skip to content

Latest commit

 

History

History
19 lines (15 loc) · 686 Bytes

README.md

File metadata and controls

19 lines (15 loc) · 686 Bytes

Create Tags For Dangling Commits

Sometimes after a force push or deleted ref commits can become unrefenced. If you no longer have access to a machine which contains the commit you'd normally be unable to access the sha.

However if you host your repository on GitHub or BitBucket the SHA will often still be available for a period of time until the repository expereinces a gc event. This tool sends the tag creation command directly to the git server and bypasses local client checks that prevent the creation of tags for non-existant shas.

Usage

ruby git-create-dangling-commit-tag.rb <SHA> <New Tag Name> <Git SSH Remote>
git fetch --tags
git checkout <New Tag Name>