Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Log Graph in TortoiseGit not showing branch/merge?

I have just started using Git on Windows. I am hosting on BitBucket and using TortoiseGit as the windows client.

Things are moving in the right directon, but I am clueless at a point. I was working on the master branch, and at one point created a new branch. Then I continued working on the new branch and kept committing, pushing. Finally when I was done, I merged this new branch(codetidy) back into master.

Now when I do 'Show Log' and select 'All Branches', I just get a straight line in the graph. There is no information of from when a branch was taken out, and when it merged back. Please hep me find this information.

Version graph

like image 528
Saurabh Kumar Avatar asked Nov 25 '12 21:11

Saurabh Kumar


People also ask

What is git merge log?

By default, git log includes merge commits in its output. But, if your team has an always-merge policy (that is, you merge upstream changes into topic branches instead of rebasing the topic branch onto the upstream branch), you'll have a lot of extraneous merge commits in your project history.

How do I merge branches in terminal?

To do a merge (locally), git checkout the branch you want to merge INTO. Then type git merge <branch> where <branch> is the branch you want to merge FROM.

How do I merge Checkout branches?

To merge branches locally, use git checkout to switch to the branch you want to merge into. This branch is typically the main branch. Next, use git merge and specify the name of the other branch to bring into this branch. This example merges the jeff/feature1 branch into the main branch.


1 Answers

That's probably because your merge was a fast-forward merge, which means that there weren't any commits made to master in between the time when codetidy was created and when it was merged back in - so Git helpfully just moves master to point to the same commit (because it already has the exact same file contents as what a merge would look like), rather than creating an unnecessary merge commit.

If you don't want this behavior, you'd need to force Git to create a separate merge commit - on the command line, this is done with git merge --no-ff. In TortoiseGit, it's done via checking the "No Fast Forward" checkbox in the merge window (see this previous StackOverflow answer for a screenshot).

like image 200
Amber Avatar answered Oct 04 '22 06:10

Amber