Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

SQL Query to list all the repoistory name and their branch in bitbucket DB

Dchosen July 25, 2019

Need to just list all the Repositories and their Branch names in bitbucket db.

1 answer

0 votes
Stephen Sifers
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 29, 2019

Hello Rahul,

If you’re looking to locate the repos within Bitbucket within the database the good news is there is an article to do this. The article does not cover how to match to branches, however. But the article does show how to query the repos within Bitbucket. You may find this article at Identifying a Repository on the Bitbucket Server.

SELECT name, id FROM <DataBase>.repository; 

Regards,
Stephen Sifers

Dchosen July 31, 2019

Hi Stephen,

 

Thanks for query, I am going to rephrase the question.

SQL query where I can list all the repositories with their active branches name. I knew about the repo name though. 

 

Thank You

Stephen Sifers
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 1, 2019

Hello,

The database does not store any information that would be helpful for combining Repo and Branch data. With this said, the alternative to get further information on this would be to use the REST API to access the data. A concept of this idea would be implemented with the following bb-project-repo-listing while including the branches from the REST API (/REST/API/1.0/PROJECTS/{PROJECTKEY}/REPOS/{REPOSITORYSLUG}/BRANCHES?BASE&DETAILS&FILTERTEXT&ORDERBY)

I hope this proves helpful and you’re able to get the combined data you need.

Regards,
Stephen Sifers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events