Vulgo
Vulgo

Reputation: 35

Network graph from github

I am new to the git, and started a simple project, just to learn about branches and commits. My problem is with the github network graph tool.

Here is the log:

After that, my new goal was to merge the main branch with the layout-creation branch. For that, I used these command lines:

I expected the graph to look like this

but it looks like this

What do I have to do in order to achieve the first graph (with command lines)?

Upvotes: 2

Views: 868

Answers (1)

bk2204
bk2204

Reputation: 76774

You did what's called a fast-forward merge. When you do git merge and one branch is a superset of the other, by default, Git just updates the branch you're merging into to be exactly the same as the other branch.

If you want to create a merge commit in such a case, then you want to add the --no-ff option to do so. That will result in a merge commit, which will give the graph the expected shape.

Upvotes: 3

Related Questions