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

Bitbucket Branch History

Baharul August 5, 2021

Hi Team,

 

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

 

Thanks

Baharul Islam

1 answer

0 votes
Michael Walker
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 10, 2021
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
TAGS
AUG Leaders

Atlassian Community Events