Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
756 views
in Technique[技术] by (71.8m points)

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

Ok I've had a little google and can't find a solution as i've stumbled across the same message but different ways in which people have got it. I'm new to mecurial and want to make sure i'm doing this correctly.

So i'm getting the error message as above. I have a dev site and a live site and i'm trying to push the code to codebase.

However yesterday I accidentally did hg add which added all the media which i didn't want to do. I did revert after to remove all the media files from codebase, by then committing and push the changes. So today i've been making changes to the CSS file and a few templates. I've gone to commit my changes and push them but when i run hg push I get the error above.

I've run hg log and there are only 6 commits as it's a clean/new branch/project. Any help would be much appreciated and I apologize if i've not explained anything correctly!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

This isn't an "error" message; it's a totally normal situation. That message is saying "hey, other people pushed new work to that repository while you were doing your work, you should probably integrate theirs into your so they don't have to integrate yours into theirs?"

So first do a:

hg pull

and then a:

hg merge

Incidentally the revert you did if you actually used the hg revert command didn't remove those files from history, so your history is probably pretty big.

Consider reading the first few chapters of the Mercurial book it covers these situations quite well.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...