How do I find a bitbucket repo name from its numeric ID?..

We can find which repo corresponds to the numeric ID on disk from this:
but how do we find the repo name,  ie. the other way around?..


1 answer

0 vote
Jeff Thomas Atlassian Team Apr 24, 2017

Hi Sean,

If you're running Bitbucket Server 4.12+, this information is included in the repository-config file found in the root of the repository. For example, the contents of the file include:

 hierarchy = 11b8c8403bf885772b6f
 project = TEST
 repository = repo999

This improvement was tracked at

If you haven't upgraded to to 4.12 yet, you can run the following database query to get the information:

FROM repository
JOIN project ON = repository.project_id
WHERE = 1;


Thanks for that.
We are running 4.8.2.
I couldn't find that particular file but the ticket says
data/repositories/1/config (for example)

So, for us it shows:

repositoryformatversion = 0
filemode = true
bare = true
packedgitlimit = 256m
packedgitwindowsize = 32m
receivepack = true
[gc "stash-refs/pull-requests/*"]
reflogExpire = never
reflogExpireUnreachable = never
hierarchyid = 4d84f350b24a685b122c




Jeff Thomas Atlassian Team Apr 26, 2017

Hi Sean,

The repository-config file won't exist until you're running at least 4.12. Since you're on 4.8, the DB query should give you the information you're after.

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Published Dec 27, 2017 in Bitbucket

Recipe: Deploying AWS Lambda functions with Bitbucket Pipelines

Bitbucket Pipelines helps me manage and automate a number of serverless deployments to AWS Lambda and this is how I do it. I'm building Node.js Lambda functions using node-lambda&nbsp...

2,049 views 1 5
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you