水星错误:存储库不相关 [英] Mercurial error: repository is unrelated

查看:78
本文介绍了水星错误:存储库不相关的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚开始使用Mercurial,我在Bitbucket上有一个中央"存储库,我将其克隆到一台计算机上并进行了更改,提交和推送.然后,我从Bitbucket复制到另一台提交并推送的计算机,这很好.然后,我回到第一台计算机,提交更改并尝试推送,但收到错误消息.我究竟做错了什么?我应该先拉吗?如何解决错误并推送?任何帮助表示赞赏!

I've just started with Mercurial, I have a 'central' repository on Bitbucket which I cloned onto one machine and made changes and committed and pushed. I then cloned from Bitbucket to another machine committed and pushed which was fine. I then came back to the first machine, made changes committed and attempted to push, but got the error message. What am I doing wrong? Should I have pulled first? How can I resolve the error and push? Any help is appreciated!

达伦.

推荐答案

当您在Mercurial存储库中进行第一次提交时,它会获得其标识.在Bitbucket上创建新存储库时,将创建一个没有身份的空存储库.

A Mercurial repository gets its identity when you make the first commit in it. When you create a new repository on Bitbucket, you create an empty repository with no identity.

当您将此存储库克隆到计算机A并进行提交并将其推回时,您就对存储库进行了标记.如果您在从第一台计算机推送到 之前在第二台计算机上克隆了存储库,那么您可能会遇到您所描述的情况.

When you clone this repository to machine A and make a commit and push it back, then you brand the repository. If you have cloned the repository on the second machine before pushing from the first, then you can end up in the situation you describe.

请在无法推动的机器上运行hg paths.然后,对将要推送到的存储库进行单独的克隆.现在,使用

Please run hg paths on the machine where you cannot push. Then make a separate clone of the repository it says it will push to. Now examine the first changeset in each repository with

hg log -r 0

如果初始变更集不同,那么您将拥有两个不相关的存储库,如我们在Mercurial中所称.然后,您可以将无法推送的更改导出为补丁,然后将其导入其他补丁.

If the initial changesets are different, then you have two unrelated repositories, as we call it in Mercurial. You can then export the changes you cannot push as patches and import them in the other.

这篇关于水星错误:存储库不相关的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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