13

Code base getting large. Decided to get better at GIT...

I am using xCode and decided to move away from xcode git and to SourceTree. I am keeping my code local on my machine but would like to get into the git flow habit. I opened Sourcetree and imported my project. All looks good.

I did a final commit and initialized GitFlow. But as I move from Master branch to Development Branch to creating Feature Branches, I see the branch names in the log, but I do not see the parallel gitflow colored lines. Is that because my project is local and I am not doing any Pull/Push? or am I missing a setting?

PS: Using xcode 5. Not sure if related.

Khaled Barazi
  • 8,681
  • 6
  • 42
  • 62

2 Answers2

15

You're getting a flat graph because you have a flat history:

As soon as you're committing to another branch, the difference is shown:

git checkout develop
# make some changes
git commit -m "Changes to develop"

Starting and committing to another feature branch in parallel results in something like this:

Stefan
  • 109,145
  • 14
  • 143
  • 218
  • 4
    I'm having the same problem and regardless of how many commits I make to any branches I still get the flat Graph like the first image. – Kent Mar 16 '14 at 01:23
2

In addition to Stefan's answer it might be because of your log filters being set in such a way that it won't show the other branches which would be worth checking. If it's set to 'current branch' you may only have one line of development. Also, if you have a flat history as mentioned (which is often the case) then it'll show a singular line of development.

Kieran Senior
  • 17,960
  • 26
  • 94
  • 138
  • Since I'm having the same problem, I can say that I've got my filters set to show all branches in the log. The only thing I saw that wasn't flat was after I merged ("finished") a feature branch (with delete) the colored branch showed the divergent path with commit comments--but only after the fact, not while I was working on that feature. – Kent Mar 16 '14 at 01:25
  • If history didn't diverge then it is true to form that the visual ancestry will show a single path of development, despite your attempt to show otherwise. If you merge in your feature branch and something changes in the target branch whilst you were developing that feature branch, then there will be a merge point so separate lines of development. – Kieran Senior Mar 16 '14 at 12:57
  • 1
    Thanks. I think it makes sense now. It only shows the divergence if there are two or more concurrent changes to different branches? – Kent Mar 16 '14 at 16:04
  • The divergence will show when, after the branch point, a change happens in the source branch that didn't happen in the target branch. – Kieran Senior Mar 16 '14 at 17:56
  • Thanks. I did notice that after I finished my feature and it merged back into develop (with the delete feature option turned on) that my graph now shows the feature divergence in pink but unnamed (I suppose since it's deleted) but I don't remember if this was immediately after I committed locally or only after I pushed it to my remote repo (where I had to delete the feature by hand since it didn't delete automatically like the local one did). I thought it weird to see the divergent graph only at that point. – Kent Mar 16 '14 at 18:47
  • Yeah, it can be confusing sometimes. We get a lot of issues opened to say that the graph is showing incorrectly when it's actually correct. To be honest I used to get confused by the graph history as I always expected it to diverge. There are options to show the history differently, i.e. date ordered or ancestor ordered history. You need to think more in terms of ancestry rather than lines of development though, and that usually helps. – Kieran Senior Mar 17 '14 at 07:31