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
![](https://github.blog/wp-content/uploads/2023/10/Collaboration-DarkMode-2.png?resize=400%2C212)
2024 is the biggest global election year in history. What’s at stake for developers?
GitHub is considering what is at stake for our users and platform, how we can take responsible action to support free and fair elections, and how developers contribute to resilient democratic processes.
![](https://github.blog/wp-content/uploads/2023/10/AI-DarkMode-2.png?resize=400%2C212)
GitHub named a Leader in the Gartner first-ever Magic Quadrant for AI Code Assistants
This year, as part of its annual Magic Quadrant series, Gartner published a first-of-its-kind report analyzing the state of play in the AI Code Assistants market–and named GitHub a Leader.
![AI in software development 2024 survey results with colorful graphics and percentages.](https://github.blog/wp-content/uploads/2024/08/ai-survey-header.png?resize=400%2C212)
Survey: The AI wave continues to grow on software development teams
We surveyed 2,000 people on software development teams at enterprises in the U.S., Brazil, India, and Germany about the use, experience, and expectations around generative AI tools in software development.