Github Ahead / Behind Metrics Value

In a simple language (hopefully with a simple example), what do the front / back indicators on the Github repo branch mean?

And what are the implications for this industry and the attention it receives? Is "behind" a bad sign for a branch?

+42
branch github repository
Jul 10 '11 at 20:23
source share
4 answers

Ahead is the number of commits on this branch that do not exist in the base branch. Behind is the number of commits on the base branch that are not in this branch.

The front and back are almost a bit of an β€œage” metric. The leading number tells you roughly how much the industry has on the base branch if it is merged. The trip number tells you how much work has happened on the base branch since this branch was started.

I believe that a spare number is really useful for judging whether a merge branch can be clean. When a lot of work has happened on the base branch, it is more likely that the two branches changed the same line (s). When large is behind, this is a sign that you should probably merge the base branch into this branch for synchronization. Once you merge the base branch into this branch, there will be 0 behind.

+52
Jul 11 2018-11-11T00:
source share

If you look like a visual type, look here:

β—ˆ - β—ˆ - A - β—ˆ - B \ β—ˆ - C 

A - 2 fixations behind, and 0 - in front of B
B is 0 and 2 is ahead of A
C - 1 latch, and 2 - in front of A
C - 3 fixations at the back and 2 - before B

So, β€œbehind” means that the other branch does this, and β€œin front” means that this branch does the other, it does not.

+44
Jul 11 2018-11-11T00:
source share

Metrics like the ones you can see for this project describe a comparison with a branch from a repo (e.g. master )

  • the number of new commits that were made by the GitHub repo compared to the other branch of another repo: these are the tags behind : the other repo is behind the current repo (see those commits ).
  • the number of new transactions is made by a different branch of another repo compared to the current repo: those in front commit: another repo in front compared to the current repo (see those commits ).

The technical detail is illustrated by a script "defining which repositories are ahead / behind" :
It's about checking:

  • what it does is accessible from another branch, but not from a local branch: in front of git rev-list "$localref..$anotherref"
  • what it does is accessible from the local branch, but not from another branch: behind git rev-list "$anotherref..$localref"
+5
Jul 10 2018-11-21T00:
source share

At the same time, it should be noted that github "behind" also takes into account merging. You can check the "behind" things: git log mybranch1 ^ mybranch2, and it should show you the same number of commits. If you have merges, you can exclude them from -no-merges in the last command.

+1
May 26 '13 at 9:48
source share



All Articles