Branch Lists
Git’s branching model is one of it’s best features. Branches are cheap, fast and extremely flexible. They’re great for developing features, maintaining old releases, or just plain experimentation. If you…
Git’s branching model is one of it’s best features. Branches are cheap, fast and extremely flexible. They’re great for developing features, maintaining old releases, or just plain experimentation.
If you spend a lot of time with git, you’ll also find that there’s a lot of really useful information to be discovered in the way git can compare various branches. We’re using some of this information to generate our new branch list page (you can get to this page from the ‘Branch List’ subnav item under Source).
Check in on your topic branches in one glance
Not only do these new branch list pages show you which branches exist on your remote, but you can see at a glance how they compare to any branch.
Each branch has what we call a divergence graph. On the left side of the black bar we show how many commits that branch is behind (commits in master not found in the branch). On the right side, we show how many commits that branch is ahead (commits found in the branch, but not in master). The colors of the bars indicate how recent the last commit was.
In that one graphic, you get an idea of when the last time each branch was updated with master, how far along that branch is, and if people have been working on it recently.
These graphs also have some implicit rules that can help when merging:
- No left side bar – This branch is safe to merge with your base branch and there will not be any conflicts.
- No right side bar – This branch has already been merged into your base branch, so it’s probably ready to be deleted.
- Large left and right side bars – This branch is probably going to be difficult to merge. There’s a lot of unique commits in the branch and in your base branch so the likelihood of merge conflicts is much higher.
Having fun with Rails releases
This view can also be fun to glean some information out of Rails releases. Rails keeps a branch for each point release. If we take a look at the branches with 2.2 as the base, we get a pretty interesting page
Using the divergence graphs, we can see how each of the point releases of Rails compare to the 2.2 release. You can also see that there was almost as many commits from 1.2->2.2 as there has been from 2.2->master (Rails 3 beta).
Compare View
The last piece of the branch lists page is the compare button on each branch. This is an awesome feature–but I think I’ll leave it to Ryan to explain in more detail.
Written by
Related posts
What 986 million code pushes say about the developer workflow in 2025
Nearly a billion commits later, the way we ship code has changed for good. Here’s what the 2025 Octoverse data says about how devs really work now.
Introducing Agent HQ: Any agent, any way you work
At Universe 2025, GitHub’s next evolution introduces a single, unified workflow for developers to be able to orchestrate any agent, any time, anywhere.
Octoverse: A new developer joins GitHub every second as AI leads TypeScript to #1
In this year’s Octoverse, we uncover how AI, agents, and typed languages are driving the biggest shifts in software development in more than a decade.