Mercurial和xcuserdata,.ds_store和.git [英] Mercurial and xcuserdata, .ds_store, and .git

查看:88
本文介绍了Mercurial和xcuserdata,.ds_store和.git的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Mercurial noob在这里.使用Mercurial和文件(例如xcuserdata和.ds_store和.git)时遇到很多麻烦.我机智.

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.

在制作.hgignore文件之前,先前已推送了包含不需要的文件(xcuserdata,git,ds_store)的提交.这引起了噩梦.

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

我尝试过的事情:

我尝试忽略问题并让合并处理,但是由于冲突(每次推送中的冲突都不会显示在终端中,因此每次推送都导致中央存储库上的分支出现,所以我没有机会合并到推送中) )并破坏项目文件,以至于导致文件合并(如filemerge和kdiff3)挂起.

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.

我尝试制作一个本地.hgignore文件,并在xcuserdata上使用hggot来停止跟踪这些内容,但是它仍然会推拉那些不需要的文件.

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.

我想发生的事情:

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

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?

谢谢

推荐答案

简单地hg forget您要删除的文件并将其推送到服务器.下次团队的其他成员将从存储库中提取文件时,这些文件也将被遗忘在他们的身边.

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.

请注意,forget仅适用于当前分支,如果您有其他分支,则必须在每个分支上都这样做.

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

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

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 !

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

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

否则,如果您真的想从历史记录中完全删除文件,则可以使用MQ扩展名,但这是另一回事了,它更加复杂和无用,恕我直言.

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.

这篇关于Mercurial和xcuserdata,.ds_store和.git的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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