如何告诉“hg update”它可以删除我工作目录中的任何新文件?
- 我
克隆
一个存储库到c:\mycopy - 我在我的工作目录中创建了新文件
我如何告诉hg update
删除我工作目录中的任何新文件?我不希望它删除属于忽略文件模式的文件。
- I
clone
a repo to c:\mycopy - I create new files in my working dir
How can I tell hg update
to delete any new files in my working dir? I don't want it to delete files that are in the ignored file patterns.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
使用清除扩展。不会更新,但更新后可以清除。
Use the purge extension. It won't be update doing it, but you can purge after updating.
危险,威尔·罗宾逊!危险!危险!
我强烈建议您不要尝试这样做。这是一个用户故事:
那是一个漆黑的暴风雨之夜。雨水和冰雹敲击着窗户,听起来就像猎户座肩上发生的一场被遗忘已久的战斗中重型武器的火力在时间中回响。程序员承受着难以置信的压力,试图完成拯救人类的最后一个关键代码片段。 突然他知道他拥有了它!他快速更新,然后进行提交! ...但他忘记首先执行
hg addwhat
将文件添加到他的存储库中,他的神奇清理脚本会立即销毁代码,永远不会再次被回收。人性丧失了……迷失了!
而这一切都是因为自动清理脚本。
YMMV。
Danger, Will Robinson! Danger! Danger!
I strongly recommend you do not even try to do this. Here's a User Story:
It was a dark and stormy night. Rain and hail beats against the window, sounding like heavy weapons fire echoing through time from some long-forgotten battle fought off the shoulder of Orion. The programmer is under incredible stress, trying to complete the last critical piece of the code that will Save Humanity. Suddenly he knows he has it! He grabs a quick update and then does a commit! ... But he forgot to first do
hg add whatever
to add the files to his repository and his magic cleanup script instantly destroys the code, never to be reclaimed again.Humanity is lost ... LOST!
and all because of an auto-cleanup script.
YMMV.
该脚本将生成未知(未跟踪但未被忽略)文件的列表并将其删除。不使用
xargs
部分运行来预览哪些文件将被删除:This script will produce a list of unknown (untracked but not ignored) files and remove them. Run without the
xargs
part to preview which files will be deleted: