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

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Bitbucket Branch History

Baharul I'm New Here Aug 05, 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
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
This widget could not be displayed.
TAGS
Community showcase
Posted in Bitbucket

How do you use the Bitbucket-Jira integration? How does it help your team?

Hey everyone, over the past year, we've added several new features on how you can use Bitbucket and Jira together. We'd love to know how you are using the integration and how it's helping your team...

892 views 5 3
Join discussion

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