4

I'm trying to understand some parts of the GIT graph in Eclipse.

We'll refer to commiters as G, A, R, J and K.

In this case, we have two branches : master, and agfa (dev branch). Commit 5cc4355 : What does the green line means? It's not a new branch, so I guess it means the local repository has diverged... somehow. Commit 9d4035d : Here, "A" merged the agfa branch to the master. But why is the merge on the yellow line, instead of the actual master? (blue).

I guess I'm just confused by the fact that simultaneous developpers works on different workspace... but if someone could confirm what's happening, that would be very helpful :)

kgui
  • 4,015
  • 5
  • 41
  • 53
ALansmanne
  • 271
  • 1
  • 6
  • 17

1 Answers1

4

Eclipse links related commits with colored lines to help you read the commit graph, but those colored lines have little to do with branches (in the Git sense).

The Git terminology is a bit confusing, but remember that a branch is nothing more than a reference that points to a particular commit at a given time.

You shouldn't conflate Git branches and whatever your IDE uses to represent a sequence of related commits.

Commit 5cc4355 : What does the green line means? It's not a new branch, so I guess it means the local repository has diverged... somehow.

Note that two lines (blue and green) stem from commit 5cc4335. This indicates a divergence in history: two different branches were originally pointing at that commit, but then different things happened in those two branches (i.e. different commits were created on those two branches), hence the divergence at that node of the commit graph.

Here, "A" merged the agfa branch to the master. But why is the merge on the yellow line, instead of the actual master? (blue).

That commit message indicates that, when contributor A merged branch agfa into master, master was pointing at commit 9d4035d. The color of the line (yellow) is irrelevant.

Community
  • 1
  • 1
jub0bs
  • 60,866
  • 25
  • 183
  • 186
  • Ok, It's a bit more clear. As for the colour, I know, it's just random. – ALansmanne Nov 10 '14 at 13:35
  • When you said "two different branches were originally pointing at that commit, but then different things happened in those two branches", could it be the same branch (master), but on two developper's workspaces? – ALansmanne Nov 10 '14 at 13:41
  • @ALansmanne Yes. It looks like one developer (Alice) made a commit on her master branch and pushed to remote; in the meantime, another developer (Bob) made a commit on his own `master` branch; Bob then did a fetch and merged Alice's work (now in Bob'd `origin/master` remote-tracking branch) into his own local `master` branch before pushing it to remote. – jub0bs Nov 10 '14 at 13:53