善变的推/拉问题

发布于 2024-10-05 22:42:40 字数 1100 浏览 0 评论 0原文

我的团队朋友对我们的存储库执行推送操作后,我无法执行推送操作。

首先我提交,稍后我单击“推送”

Push will not be performed because it would create remote branches.

You must first resync by doing a Pull from the target repository and Merge.

后来我单击“拉取” 我得到了这个

INFO Pulling From: https://mercurial.intuxication.org/hg/itucs-blg361-2010-g27 ...
comparing with https://mercurial.intuxication.org/hg/itucs-blg361-2010-g27
searching for changes
no changes found
INFO Pulled From: https://mercurial.intuxication.org/hg/itucs-blg361-2010-g27
INFO To:        hastaneBilgiSistemi - C:\Users\yakUP\Desktop\wicket\hastaneBilgiSistemi
INFO: End of Mercurial Pull

我能做什么?

我尝试更新。它说:

Mercurial Update
----------------
Update to revision 25 in:
C:\Users\yakUP\Desktop\wicket\hastaneBilgiSistemi
abort: crosses branches (use 'hg merge' to merge or use 'hg update -C' to discard changes)

INFO: End of Update

图表就像: 替代文本 alt text我是 Mercurial 新手。

After my team friend did a push operation on our repo I can't do push operation.

First I commit later I click push

Push will not be performed because it would create remote branches.

You must first resync by doing a Pull from the target repository and Merge.

Later I click pull I got this

INFO Pulling From: https://mercurial.intuxication.org/hg/itucs-blg361-2010-g27 ...
comparing with https://mercurial.intuxication.org/hg/itucs-blg361-2010-g27
searching for changes
no changes found
INFO Pulled From: https://mercurial.intuxication.org/hg/itucs-blg361-2010-g27
INFO To:        hastaneBilgiSistemi - C:\Users\yakUP\Desktop\wicket\hastaneBilgiSistemi
INFO: End of Mercurial Pull

What can I do?

I tried update. It says:

Mercurial Update
----------------
Update to revision 25 in:
C:\Users\yakUP\Desktop\wicket\hastaneBilgiSistemi
abort: crosses branches (use 'hg merge' to merge or use 'hg update -C' to discard changes)

INFO: End of Update

graph is like:
alt text
alt textIm new to mercurial.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

野生奥特曼 2024-10-12 22:42:40

要获取有关在服务器上创建新头的消息,但拉动说没有新的变更集,意味着您已经拥有服务器上的所有变更集。

您应该做的是查看本地克隆并将多个头合并在一起以再次获得一个头,然后您应该能够推送。

但是,您可能无法在 Windows 上执行此操作(根据问题中的路径示例判断),因为两个文件之间存在大小写折叠冲突:

  • src/java/itucs/blg361/hbs/linkpage.java < ;-- 请注意 linkPage src/java/itucs/blg361/hbs/linkPage.java 中的小写 p
  • <-- 请注意 linkPage 中的大写 P

这将阻止您实际使用该分支,除非有人拥有考虑的系统两个不同的文件(如 *nix)会为您删除其中一个,推送它,然后您拉入新的变更集。

因此,您有几个选择:

  • 使用 --override (或等效的 GUI)强制推送。这通常不是正确的方法。这将在服务器上创建另一个头,然后突然间您将拥有该项目的至少 3 个不同版本。
  • 拉动(就像你所做的那样),合并,然后推送。这通常是首选。您应该将属于在一起的头合并在一起以返回到一个分支。

无论如何,我会弄清楚为什么存储库中已经有多个头了。有人强行推吗?是故意的吗?

并获取TortoiseHg - 它会让您的生活更轻松

To get the message about creating new heads on the server, yet pull saying there is no new changesets, means that you already have all the changesets from the server.

What you should do is look in your local clone and merge the multiple heads together to get one again, then you should be able to push.

However, you probably won't be able to do this on Windows (judging by the path examples in your question) since there is a case-folding collision between two files:

  • src/java/itucs/blg361/hbs/linkpage.java <-- notice lower-case p in linkPage
  • src/java/itucs/blg361/hbs/linkPage.java <-- notice upper-case P in linkPage

This will prevent you from actually using that branch unless someone with a system that considers the two to be different files (like *nix) gets rid of one of them for you, pushing that, and then you pulling in that new changeset.

So you have a couple of options:

  • Force the push with --override (or the GUI equivalent). This is usually not the right way. This will create another head on the server, and then suddenly you have at least 3 different versions of the project.
  • Pull (like you've done), merge, then push. This is usually the preferred choice. You should merge together the heads that belong together to get back to one branch.

In any case, I would figure out why you have multiple heads in the repository already. Did someone force a push? Was it intentional?

And get TortoiseHg - It'll make your life easier

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文