How to Interpret BitBucket Cloud Commits graph?
Asked by Andrew Wagner:

Can someone please explain to me how to interpret the BitBucket Cloud Commits graph?

* Would be nice to highlight a colored node and have it tell me what branch it is
* Would be nice if the colorization of branches in 'All Branches' were maintained when I choose a particular branch?
* Sometimes it appear that colors are reused?
* When I search Atlassian for help all it comes up with are Fisheye references.


Answers:
author: Theodora Boudale
body: Hi Andrew,

Each node in the commit graph represents a commit and the lines represent parent relationships.

Each line is not necessarily a separate branch. A branch is nothing more than a pointer to a commit. If you have two branches pointing at the same commit, you will see one line for both branches in the commit graph. For commits that don't belong to a repo's main branch, you can see which branches a commit is reachable from at the left of the Date field on this page.

We have a feature request for providing a tooltip that shows the branch(es) name when hovering over the graph:

* <https://jira.atlassian.com/browse/BCLOUD-21073>

The request has been closed as it's not likely to be worked on in the near future. However, you can still add your feedback there to express your interest, as our product managers continue to monitor even closed requests.

Kind regards,  
Theodora

comments: author: Andrew Wagner
body: Theodora,

Thank you for your helpful response. Some follow up questions:

* OK, so each line is not a branch
* What does it mean to have multiple nodes on a line?
* What does it mean when lines merge, and what determines what color is maintained when they merge?
* When I pick a Branch there are gaps in the graph. Does that mean that there are commits in the gap?
* Can you summarize a best practice for using the Commit Graph?
* Finally, why is there not more online information on how to interpret the commit graph?

Thanks for the dialog!

Kind regards,

Andrew


author: Theodora Boudale
body: Hi Andrew,
> What does it mean to have multiple nodes on a line?

If we assume a repo with only 3 commits and a graph like this:

```
*? ?  commit C
|
*? ? ?commit B
|
*? ? ?commit A
```

Then commit A is the parent of commit B, and commit B is the parent of commit C.

> What does it mean when lines merge

This means that two branches were merged with merge commit strategy. If we assume the following graph, commit D is the merge commit, and commits B and C are the parents of D.

```
  *     commit D
 / \
*   |   commit C 
\   *   commit B
 \ /
  *     commit A 
```

I am not sure about the color of the lines after merges and the gaps in the graph, I will reach out to the development team and I will get back to you.

A commit graph is a visualization of the history of changes. You can see commits that haven't been merged to the repo's main branch, the branch(es) they belong to, and, if the commit messages are descriptive, you can see what has been worked on each commit.

I will reach out to the documentation team about creating a page with more info on the commit graph.

Kind regards,  
Theodora


author: Theodora Boudale
body: Hi Andrew,

Regarding the color of the lines in the commit graph:

Bitbucket walks through the list of commits in the repo and draws colors in this order: Green, Red, Blue, Teal, Yellow, Purple.

The branch with the most recent commit will start with green, and then it draws from there in commit order.

Assume the following graph, from a repo I created for testing purposes. In this graph, the most recent commit belongs to **master** branch, and this line is drawn in green color.

The commit after that (536e316) doesn't belong to **master** branch, but to **test2** branch, so its line is drawn in red color.

We then have commit 93acd57 which belongs to branch **test1** which is drawn in blue color.

![Screenshot 2023-10-24 at 15.18.32.png](https://community.atlassian.com/t5/image/serverpage/image-id/288045iB4C5AB44BB1C06B1/image-size/large?v=v2&px=999 "Screenshot 2023-10-24 at 15.18.32.png")

I then merged branch **test2** branch into **test1**.

Now the most recent commit is dfe85a6 which belongs to **test1** branch, so it starts with a green dot. Since this is a merge commit with two parents, it continues with the green color for one parent and with the red color for the other parent.

Finally, the last commit of **master** branch (b262243) is getting drawn by blue color.

![Screenshot 2023-10-24 at 15.22.12.png](https://community.atlassian.com/t5/image/serverpage/image-id/288046i0C487F1508FD45AB/image-size/large?v=v2&px=999 "Screenshot 2023-10-24 at 15.22.12.png")

I hope this helps understand the graph and changes in colors a little better.

<br />

Regarding the gap in the commit graph, it's something I can reproduce in one of my repos (but not in every repo) and it looks like a bug. I noticed that if I do a hard refresh on my browser the gap disappears and all the commits that belonged to this gap, are not connected with lines.

* Does a hard refresh on your browser solve the issue for you?
* If it does, can you please confirm if you see the same commits as when there was a gap, only now connected with a line?  

  In the repo where I reproduced this issue, a hard refresh shows the same commits. I would like to understand if this is the case for you as well and if the gap is only in the line and if no commits are missing.

Kind regards,  
Theodora


Tags: bitbucket-cloud

cloud