0

My Git tree looks like this.

Git Tree

All I did was create two branches A and B and then merged them in one after the other after rebasing with master. then I deleted those branches from remote as well as local. But even then my tree looks like this. What could be wrong? and how can I fix it? I am connecting to a GIT repo on VisualStudio hosted online.

user20358
  • 14,182
  • 36
  • 114
  • 186
  • 1
    What makes you think this is wrong? You say you merged two branches; the graph above shows `master` pointing to a merge commit, with two branches; and that's what you did, so that's what I would expect to see. – torek Sep 17 '15 at 20:01
  • as far as I know it should be a straight line when you only have a master and no other branches. Is there any document on how to read the GIT branch tree and figure out whats going on? I am trying to figure out how to read the state of the repo by looking at the branch in gitk – user20358 Sep 18 '15 at 07:23
  • Beware of the multiple meanings of the word "branch", in git. You do only have one branch (`master`), which has two branches (that have no names). In one case we're referring to the label giving the tip commit, and in the other we're referring to the commit graph. See also http://stackoverflow.com/questions/25068543/what-exactly-do-we-mean-by-branch – torek Sep 18 '15 at 07:39

1 Answers1

0

I don't think the tree is mess up.

Merge has some options(Fast Forward) that may help you. If you don't want to merge to create a separate road, you should use ff. If you're going to do what you did above, use no-ff.

git merge myBranch --ff

or

git merge myBranch --no-ff

You can try running two commands to see the difference.

Carson
  • 6,105
  • 2
  • 37
  • 45