Compare Branches

During development, branches diverge from other branches in your repository, you might have committed changes in one branch that have not been merged into another, and vice versa. This type of change is normal and to be expected, but over time it can lead to the creation of "dead" or "stale" branches that can bloat your repository and make development difficult. You can use the Branches page to determine how divergent the branches in the repository are and then take steps to address it (by merging or pruning, for example).

GitCentric presents information about a branch’s divergence in terms of how far ahead (numAhead) and how far behind (numBehind) the commits in a given branch are from those in the branch you choose as your baseline.

Consider the following illustration of a simple commit graph, where each O represents a commit:

Here, branch 5.1 is considered to be 3 commits ahead of master, and 5 commits behind master.

To compare one branch with others in the repository:

  1. Click the Branches tab to display the Branches page.

    The Repo and Base Branch fields retain their last values, even if they were set on the Commits or Source Tree pages.

  2. If necessary, select the repository from the Repo list. If available, the master branch for the repository you choose is selected by default in the Branch field. Otherwise, GitCentric displays the first branch in the repository based on an alphanumeric sort.
  3. Use the Base Branch list to choose the branch against which you wish to compare all other branches in the repository. For example, if you want to see how a the site branch compares to master, you would choose master.
    Note: You cannot compare tags using the Branches page.

    The branch you choose as the baseline is moved to the top of the page and highlighted. The other branches in the repository are displayed in ascending ordered by the number of commits they are behind the baseline branch (numBehind).