推创建新的远程头! (您是否忘记合并?使用push -f强制) [英] Push creates new remote heads! (did you forget to merge? use push -f to force)

查看:35
本文介绍了推创建新的远程头! (您是否忘记合并?使用push -f强制)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好吧,我有一个小小的google,找不到解决方案,因为我偶然发现了相同的消息,但是人们得到消息的方式不同.我是Mercurial的新手,想确保自己做的正确.

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.

但是昨天我不小心做了hg add,它添加了所有我不想做的媒体.之后,我确实还原了从代码库中删除所有媒体文件的方式,然后提交并推送了更改.因此,今天我一直在更改CSS文件和一些模板.我已经提交了更改并推送了它们,但是当我运行hg push时,我得到了上面的错误.

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.

我已经运行了hg log,并且只有6次提交,因为它是一个干净的/新的分支/项目.任何帮助将不胜感激,如果我没有正确解释任何内容,我深表歉意!

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!

推荐答案

这不是错误"消息;这是完全正常的情况.该消息说:嘿,其他人在您执行工作时将新工作推送到该存储库,您可能应该将他们的工作集成到您的工作中,这样他们就不必将您的工作集成到他们的工作中了吗?"

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?"

所以首先要做一个:

hg pull

然后是:

hg merge

顺便说一句,如果您实际使用hg revert命令执行的revert并没有从历史记录中删除这些文件,那么您的历史记录可能很大.

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.

考虑阅读 Mercurial本书的前几章,它很好地涵盖了这些情况.

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

这篇关于推创建新的远程头! (您是否忘记合并?使用push -f强制)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆