Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Am I doing merge wrong? History is lost

Frode Nilsen February 23, 2014

A week ago I started a new branch in SourceTree by clicking the big Branch button, selected "New branch" and gave it name "#375". I then did a handful of commits before merging into the master branch by following the following procedure:

  1. Checked out the master branch
  2. Merged branch #375 into master branch
  3. Committed and pushed

Se image below. Why do I not see the blue line splitting into two lines at the "original branch point", and then being merged into one line again at the "merge point"?

I'm fairly new to both git and SourceTree, but I'm familiar with mercurial hg, in which this procedure was trivial. I was expecting the same procedure to work here. Help?

SourceTree screenshot

**Edit**: I realize I haven't done any commits on the master branch in the meantime, which may be the cause for it being invisible. Yet I'd still like to know the point at which I started branch #375 for historic reasons. For instance if I want to rollback the feature represented by this branch.

2 answers

1 accepted

2 votes
Answer accepted
Frode Nilsen February 25, 2014

The problem was solved by checking "Create a new commit even if fast forward is possible"

Seth
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 25, 2014

Good call. I guess my work repo is active enough that fast forwards are never possible expect when I'm pulling.

1 vote
Seth
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 23, 2014

It looks like you checked the "rebase" option which re-writes your history to make it appears as though all the commits from one branch (#375) were made directly to the other (master).

To fix you history, checkout master and do a hard reset to the original branch point. Then run the merge again, and make sure NOT to rebase.

Frode Nilsen February 25, 2014

Actually it was as simple as checking "Create a new commit even if fast-forward is possible", but your answer lead me on track so thanks.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events