Push creates new remote heads! (did you forget to merge? Use push -f to force)

Well, I had a bit of google and I canโ€™t find a solution since I came across the same message, but different ways to use it. I am new to mecurial and want to make sure that I am doing this correctly.

So, I get an error as above. I have a development site and a live site, and I'm trying to push the code to the code base.

However, yesterday I accidentally made hg add , which added all the media that I did not want to do. I returned after deleting all the media files from the code base, and then committed and pushed the changes. Therefore, today I made changes to the CSS file and several templates. I went to make my changes and push them, but when I run hg push , I get the error above.

I ran hg log and there are only 6 commits since this is a clean / new branch / project. Any help would be greatly appreciated, and I apologize if I did not explain anything correctly!

+66
mercurial
Sep 10 '13 at 16:28
source share
6 answers

This is not an error message; this is an absolutely normal situation. This message says: "Hey, did other people push a new job to this repository, while you were doing your work, you probably need to integrate them into yourself so that they cannot integrate yours into yours?"

So first do a:

 hg pull 

and then a:

 hg merge 

By the way, revert , if you really used the hg revert command, did not delete these files from the history, so your history is probably quite large.

Consider reading the first few chapters of the Mercurial book , he describes these situations well enough.

+65
Sep 11 '13 at 4:02
source share

If you want to undo your conflicting changes

 hg outgoing 

You should see lines containing your modified or conflicting changes that are not pushed. Find the revision of the changes. Here 64

 searching for changes changeset: 64:1830948c246e 

Then

 hg strip 64 
+16
Jan 23 '16 at 20:20
source share

It worked for me.

 hg push -f 

For more command try

 hg help push 
+15
Apr 14 '16 at 2:22
source share

On TortoiseHg you can do this:

1 => Commit files

2 => Go to your new branch where you want to click the code

3 => In this thread, run Merge with develop

4 => Press your code without errors!

+1
Jan 09 '18 at 16:59
source share

The best way to work with mercurial is to create git init in a folder. And then work with git locally. Merging in git, etc., Anything. And then just drop it using mercury. This is the easiest way to work with mercury. Otherwise, mercury simply does not work.

0
Dec 05 '18 at 16:08
source share

If you use Workbench to make changes, you can first try to detect outgoing changes, see the attached image. enter image description here

This will give you information about what you are about to click. My problem was, I had an old draft pending to be put forward. I managed to continue the push when I made a strip on an old project.

0
May 22 '19 at 5:40
source share



All Articles