Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,499,785
Community Members
 
Community Events
179
Community Groups

Bitbucket Server API to get information of all the branches in a repo

Edited

Hi Team,

 

I am looking for a bitbucket server api which provides details for all the  branches in a repo.

 

For ex:.

The json output should contains details like

- Author of the branch

- Creation date of the branch

- Origin branch if any.

 

curl -s -u "XXXX":"XXXXX" "https://XXXXXX.com/rest/api/1.0/projects/DEMO/repos/democonfiguration/branches?limit=2000"

 

Getting this as output

 

  • "size":1000,
  • "limit":1000,
  • "isLastPage":false,
  • "values":[
    1. {
      • "id":"XXXX,
      • "displayId":"XXX",
      • "type":"BRANCH",
      • "latestCommit":"XXXXX",
      • "latestChangeset":"XXXX",
      • "isDefault":false

I am using the above api but i am not getting the desired output (author name , creation date)

 

Can anyone please help as how can i get the creation date and author name of all branches in a repository

 

We are using 5.13.0 bitbucket server enterprise edition

1 answer

1 accepted

0 votes
Answer accepted

Bitbucket doesn't track that sort of metadata yet. You will need a plugin to do it.

Git doesn't either but there are some clever ways to find it I guess. Check out https://stackoverflow.com/questions/12055198/find-out-git-branch-creator/19135644 and see if it helps.

Hi jobin,

 

Thanks for the reply.

From the stackoverflow I tried the solutions mentioned but again we can get only the last committer of the branch since the creator metadata is not stored in git.

 

Incase you have any other way please let me know

Thanks 

Harshit

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events