中止:工作目录中未跟踪的文件与请求修订中的文件不同:'.hgignore'

发布于 2024-10-20 17:56:04 字数 408 浏览 6 评论 0原文

我正在尝试提取一些文件和目录,并且收到以下消息:

当我查看存储库时,我可以看到文件已下载,但都包含 _ 作为前缀,甚至名称文件和文件夹包含 _

requesting all changes 
adding changesets 
adding manifests 
adding file changes 
added 1094 changesets with 4304 changes to 1071 files abort:
untracked file in working directory differs from file in requested revision: '.hgignore' [command interrupted]

有什么问题吗?

I am trying to pull some files and directories and I am having the following messages:

When I look in my repository I can see that the files have been downloaded but all contains _ as prefix, and even the names of files and folders contain _

requesting all changes 
adding changesets 
adding manifests 
adding file changes 
added 1094 changesets with 4304 changes to 1071 files abort:
untracked file in working directory differs from file in requested revision: '.hgignore' [command interrupted]

What is wrong?

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

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

发布评论

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

评论(2

就此别过 2024-10-27 17:56:04

我认为您已经在工作目录中创建了 .hgignore ,但没有将其添加到存储库 (hg add)。该文件是“未跟踪的”。

来自另一个克隆的其他人也添加了此文件,并提交并推送了它。现在,当您尝试更新工作目录时,Mercurial 会尝试添加此文件,但会在工作目录中看到一个未跟踪且不同的同名文件。

有两种解决方案可以解决您的问题:

  1. 备份您的 .hgignore 文件,进行更新,并在必要时添加与备份的差异。
  2. 使用 hg add 将您自己的文件添加到存储库,然后重新运行更新。可能需要在更新之前提交文件。

我建议使用第一个解决方案。

I think you have created a .hgignore in your working directory without adding it to the repository (hg add). This file is "untracked".

Someone else, from another clone, has added this file too, committed and pushed it. Now, when you try to update your working directory, Mercurial try to add this file but sees a file with the same name in your working directory which is untracked and different.

There's two solution to your problem :

  1. Backup your .hgignore file, do the update and add the differences from the backup if necessary
  2. Add your own file to the repository with hg add, then re-run the update. It will maybe be necessary to commit the file prior to the update.

I'll advise using the first solution.

晚雾 2024-10-27 17:56:04

当您说存储库中的文件以 _ 作为前缀时,您正在往下查看 .hg 目录,不是吗?这是 Mercurial 本身的数据存储,其中的文件是修订日志,而不是您的文件。在 .hg 之外,您将有一个工作目录,其中的文件是您期望的实际文件。您现在没有得到其中之一,因为 hg update 拒绝更新工作目录,因为这样做会覆盖您未提交的 .hgignore 文件。

您正在运行什么确切命令?看起来它正在执行 hg pull ,然后执行 hg update 所以我猜 hg clone 但如果你已经有 .hgignore 躺在周围,这不是正确的命令。如果您使用 hg pull -uhg fetch 您应该只使用 hg pull 来获取变更集。然后你可以:

hg add .hgignore  # add the hg ignore file you already have that's untracked
hg commit -m .hgignore  # commit the .hgignore file you just added
hg merge  # merge your new commit (.hgignore) with the changesets you just pulled down.

When you say the files in the repository have _ as a prefix, you're looking down inside the .hg directory aren't you? That's the data store for Mercurial itself and the files in there are revlogs, not your files. Outside of .hg you'll have a working directory where the files are the actual files you expect. You're not getting one of those now because hg update is refusing to update the working directory because doing so would overwrite your uncomitted .hgignore file.

What exact command are you running? It looks like it's doing a hg pull followed by an hg update so I'd guess hg clone but if you already have a .hgignore lying around that's not the right command to use. If instead you're using hg pull -u or hg fetch you should just use hg pull instead to get the changesets. Then you can:

hg add .hgignore  # add the hg ignore file you already have that's untracked
hg commit -m .hgignore  # commit the .hgignore file you just added
hg merge  # merge your new commit (.hgignore) with the changesets you just pulled down.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文