Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cant merge: merging with a working directory ancestor has no effect

I have a windows machine with atlassian "sourceTree". The repo is synced to bitbucket.

I have a linux machine synced to the same repo. The linux machine is on revision 138.

I forgot to pull a revision, because the commit 138 on the linux machine created a new head with revision 137 on the windows machine.

screen dump from sourcetree I have made some changes on the windows machine and now have two heads.

When I try to merge I get this error:

hg merge -y ui.merge=internal:merge default abort: merging with a working directory ancestor has no effect Completed with errors, see above.

I have no idea what that means. I thought that I would be asked about which files to keep etc.

like image 556
Andreas Avatar asked Apr 03 '17 10:04

Andreas


People also ask

What happens if the merge does not go well?

If the merge does not go as you expect, you may want to revert the changes, and the Revert command will discard all changes including any you made before the merge. There are three common use cases for merging which are handled in slightly different ways, as described below.

What happens to my local changes when I merge files?

This discards all your local changes and uses the file as it arrives from the merge source. This discards all the changes from the merge source and leaves the file with your local edits. This discards your local changes where they conflict with the changes from the merge source. But it leaves all your local changes which don't conflict.

How do I merge changes into a branch from a WC?

If you want to merge changes into a branch, you have to have a working copy for that branch checked out, and invoke the merge wizard from that working copy using TortoiseSVN → Merge... . In general it is a good idea to perform a merge into an unmodified working copy. If you have made other changes in your WC, commit those first.

How do I use the merge Wizard?

The first page of the merge wizard asks you to select the method you need. This method covers the case when you have made one or more revisions to a branch (or to the trunk) and you want to port those changes across to a different branch.


2 Answers

My solution.

I updated to the revision that went wrong. From there I could do the merge.

I don't know why - but it did work.

like image 57
Andreas Avatar answered Oct 08 '22 22:10

Andreas


The solution we came up with to this same, somewhat baffling error, was simply to "touch" the older head, as in do a dummy commit, and then we were able to do the merge.

I still don't understand what caused this, but making a token update to the branch that wouldn't merge allowed us to merge them.

I hope that helps someone!

like image 41
Martin Avatar answered Oct 08 '22 20:10

Martin