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

How to recover from bad merge

Kevin Ivey January 15, 2014

I am using SourceTree to manage a BitBucket Git repository. I did a merge a couple weeks ago, but I must have goofed it up. I do not see any of the changes from the merged branch in master. When I try to merge the branch again, no changes are getting merged. I have made multiple commits in the master branch since this merge. How can I redo this merge without losing the work done in the subsequent commits.

3 answers

0 votes
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.
January 16, 2014

You might try creating a branch off of master on the commit prior to the original (faulty) merge, then merge from your other branch into this new one, and see what that branch looks like after the merge.

0 votes
Kevin Ivey January 16, 2014

None of the subsequent commits refer the files that should have been merged. What is also odd is that the commit created by the merge does not include any of the files that I would expect to find.

0 votes
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.
January 15, 2014

I'm not sure we can tell you how to fix it without a more specific idea of what went wrong. Did one of the subsequent commits somehow revert your changes?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events