Mercurial 和 xcuserdata、.ds_store 和 .git

发布于 2024-12-16 00:48:06 字数 512 浏览 4 评论 0原文

这里是善变的菜鸟。我在使用 Mercurial 和 xcuserdata、.ds_store 和 .git 等文件时遇到很多麻烦。我已经无计可施了。

当前的设置有一个充当中间人的中央存储库。我们对其进行推送和拉取更改。

在创建 .hgignore 文件之前,先前推送的提交包含不需要的文件(xcuserdata、git、ds_store)。这导致了噩梦。

我尝试过的:

我尝试忽略问题并让合并处理它,但由于冲突,它会导致每次推送时在中央存储库上出现分支(推送冲突不会显示在终端中,因此我没有机会合并) Push)并损坏项目文件,导致 filemerge 和 kdiff3 等合并工具挂起。

我尝试制作本地 .hgignore 文件并在 xcuserdata 上使用 hg忘记来停止跟踪这些内容,但它仍然会推送和拉出那些不需要的文件。

我想要发生的事情:

我希望中央存储库删除那些不需要的文件。每个开发人员仍然应该拥有这些文件的自己的本地版本。新提交将忽略这些文件。我该怎么做?

谢谢

Mercurial noob here. I'm having a lot of trouble working with mercurial and files like xcuserdata and .ds_store and .git. I'm at my wits end.

The current setup has a central repo that acts like a middleman. We push and pull changes to it.

Commits were previously pushed that included unwanted files (xcuserdata, git, ds_store) before a .hgignore file was made. This has caused nightmares.

What I tried:

I tried ignoring the problem and letting merge handle it, but it causes branches on the central repo every push due to conflicts (conflicts on push aren't being shown in terminal so I don't get a chance to merge on push) and corrupts the project file to the point that it causes merge tools like filemerge and kdiff3 to hang.

I tried making a local .hgignore file and using hg forget on xcuserdata to stop tracking that stuff, but it still pushes and pulls those unwanted files.

What I want to happen:

I want the central repo to remove those unwanted files. Each developer should still have their own local version of those files. New commits will ignore those files. How would I do this?

Thanks

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

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

发布评论

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

评论(1

裸钻 2024-12-23 00:48:06

只需hg忘记您要删除的文件并将其推送到服务器即可。下次团队的其他成员从存储库中提取文件时,这些文件也将被遗忘。

请注意,forget 仅适用于当前分支,如果您有其他分支,则必须在每个分支上执行此操作。

要自动忘记 .hgignore 中包含的所有文件,您可以

hg forget "set:hgignore()"

确保团队的每个部分都知道您对这些文件的决定,否则他们可能会在未来。沟通是这里的关键!

仅供参考,.hgignore 对存储库中已经的文件没有任何影响,它只影响未添加的文件。

否则,如果您确实想从历史记录中完全删除该文件,您可以使用 MQ 扩展,但这是另一个故事,恕我直言,它更加复杂且无用。

Simply hg forget the files you want to remove and the push it to the server. The next time the rest of the team will pull from the repository, the files will be forgotten as well on their side.

Beware that forget only works for the current branch, if you have other branches, you must do it on each of them.

To automatically forget all files contained in the .hgignore, you can do

hg forget "set:hgignore()"

Be sure that every part of your team is aware of your decision about these files, otherwise it is possible they will add theses file again in the future. Communication is the key here !

FYI, .hgignore doesn't have any effects on file already in the repository, it only affects file that aren't added.

Otherwise, if you really want to remove the file totally from the history, you can use the MQ extension, but this is another story and it is much more complicated and useless IMHO.

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