This commit is not reachable from any branch or tag in this repository.
Asked by Viraj Bhosle:

We had a heap dump in very old branch. I deleted the pull request and then the branch from bitbucket UI. But commit remained dangling now.

Commit is accessible from bitbucket ui and shows "This commit is not reachable from any branch or tag in this repository. It may be from a fork outside of this repository."

We then tried to create a branch from old local copy the repo and pushed it. It got pushed. Now commit was not dangling anymore.

then used BFG repo cleaner. It removed the large files from the branch. But now again bitbucket shows dangling commit with same error message, commit is not reachable. Spent 2 days on it so far no luck


Answers:
author: Patrik S
body: Hello [@Viraj Bhosle](/t5/user/viewprofilepage/user-id/5501370) ,

and welcome to the Community!

Once you remove some unwanted files from the history and push this cleaned-up repo to Bitbucket, the files on the server end are not deleted immediately. The deleted commits/objects become dangling and are actually wiped out by a git garbage collection (GC) process that is executed from time to time based on the repository history.

There's also the possibility of a pull request in which this removed commit was pushed in the past to hold its ref and prevent it from being deleted by GC (you can learn more about this scenario in the article [Repository size remains the same after deleting large files and running garbage collection (GC) on the remote](https://confluence.atlassian.com/bbkb/repository-size-remains-the-same-after-deleting-large-files-and-running-garbage-collection-gc-on-the-remote-1189791619.html)).

With that in mind, we from support can assist with manually triggering a garbage collection in the affected repo and check if it removes the offending commit. For that we'll need you to share the masked workplace ID and repository name, as in the following example:

* Original name: my_workspace/repository_a
* Masked version: m\*_\*\*\*\*s\*\*\*e/r\*\*\*\*\*t\*\*\*\*a

If the GC doesn't remove the commit, we can then proceed to investigate whether there are any pull requests protecting that commit.

Thank you, [@Viraj Bhosle](/t5/user/viewprofilepage/user-id/5501370) !

Patrik S

comments: author: Viraj Bhosle
body: Hi Pratik. Thanks for responding.   
Here is a masked repository name:  
z\*\*\*e\*\*g/l\*d\*\*r  

following command doesn't return anything now. But there is a dangling commit on bitbucket. Earlier it used to show the commit  
\`git log --all --full-history -- l\*d\*\*r/heapdump.2xxx.phd\`


author: Viraj Bhosle
body: [@Patrik S](/t5/user/viewprofilepage/user-id/4603309) Let me know once you have run the gc manually.


author: Patrik S
body: Hello [@Viraj Bhosle](/t5/user/viewprofilepage/user-id/5501370) ,

Thank you very much for sharing the masked repository name with us.

Unfortunately, as that workspace has a considerable number of repos, I was not able to find the exact match.

As your workspace has an active Premium subscription, I'll be opening a support ticket for you, so you can share the full repository name privately with us.

You should receive an email with the ticket link soon, but in case you don't, please let me know, and I can share it with you here (only you and Atlassian are able to see the ticket).

Thank you, [@Viraj Bhosle](/t5/user/viewprofilepage/user-id/5501370) !

Patrik S


Tags: bitbucket-cloud

cloud