You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
Hi, I would like to understand how to read and interpret a git graph. See for example the following image. I have the following questions:
1. Does color have any meaning here like green is for master, red for develop etc etc or are they just there to ease readability?
2. Does the line on leftmost (in this case green one) represent the branch I have selected from thee dropdown menu?
Hello @Mohit Sharma ,and welcome to the Community!
For your first questions about the colors, bitbucket walks through the list of commits in the repository 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.
Based on that, for your second question, when you filter the commit list by a branch, only commits reachable from that branch will be presented, so the green line (the first color that is used to draw) will represent the commit parent history for the selected branch. Other colors will represent other branches.
You can also find further details on how the commit-graph is handled in this answer to a similar question.
Thank you, @Mohit Sharma !
Patrik S
Hi there.
Git graph colors are typically used for readability, but they can convey information in some cases. To find out, check the graph legend or project documentation. Usually, master is shown in different colors, but it's project-specific.
The leftmost line usually represents the currently checked-out branch. To confirm, look for an asterisk (*) beside the branch name in the terminal or use the 'git branch' command.
Hope this helps.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.