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
Code referencing now generally available in GitHub Copilot and with Microsoft Azure AI
Announcing the general availability of code referencing in GitHub Copilot and Microsoft Azure AI, allowing developers to permit code suggestions containing public code matches while receiving detailed information about the match.
The nuances and challenges of moderating a code collaboration platform
Sharing the latest data update to our Transparency Center alongside a new research article on what makes moderating a code collaboration platform unique.
GitHub Copilot now available in github.com for Copilot Individual and Copilot Business plans
With this public preview, we’re unlocking the context of your code and collaborators—and taking the next step in infusing AI into every developer’s workflow.