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
Community Members
Community Events
Community Groups

Bitbucket Branch History

Hi Team,


How can I know branch history of bitbucket like when that branch is created , from which branch & by whom ?



Baharul Islam

1 answer

0 votes
Hey there Baharul,
Working with branches empowers us all to keep track of our commits and helps us keep a repo organized, however, Git is an interesting creature as it doesn't actually keep commits organized under branches under the hood. Branch names can easily be reused and even changed over time. They can also branch multiple times from multiple places in seemingly chaos which unfortunately makes tracing back a branch's origins nearly impossible. With that said, you do have a few options at your disposal.
First, you can use the "git log --graph --all" option (potentially with "--pretty=format:...") and visually trace back a branch to see what commit it branched from (also referred to as an Ancestor Commit) and then (assuming the history is easy enough to read/understand) trace back up to find out which branch that commit was on at the time of the branch. That at least will tell you what branch, or at least commit, a given branch came from. From there, you can use the "git log" to determine the next commit's comitter/author details, telling you who published the first change on this given branch. 

With all of that said, if you want to do things in the Web UI, you can also d them there, however, they are still a bit limited. You can absolutely look at the commit history and view the first commit and it's details all fairly easily but once a branch is created, it's still very difficult to say what branch is was created from.

Just as an extra bit of context, this stack overflow discussion goes into detail on how git keeps things organized under the hood. The question he is answering doesn't really apply to you but the answer definitely explains a lot so it may be worth reading.

Extra Note: It also looks like you can GET the parent commit details for a given branch via this REST API endpoint so give it a look if that's what you're still potentially looking for.
Best of luck!

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Bitbucket

Git push size limits are coming to Bitbucket Cloud starting April 4th, 2022

Beginning on April 4th, we will be implementing push limits. This means that your push cannot be completed if it is over 3.5 GB. If you do attempt to complete a push that is over 3.5 GB, it will fail...

2,237 views 2 9
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you