汞从回购删除目录? [英] hg remove directory from repo?

查看:73
本文介绍了汞从回购删除目录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从存储库中删除目录及其中的所有文件.

I'd like to remove a directory and all the files in it from a repo.

我已使用'hg remove'删除了所有文件,但是如何删除目录本身?

I have removed all the files with 'hg remove', but how do I remove the directory itself?

一旦我提交所有删除的文件,它会自动消失吗?

Will it just automatically vanish once I commit all the removed files?

谢谢!

推荐答案

是.由于mercurial根本不跟踪目录,仅跟踪文件,因此仅创建其中包含文件的目录,并且如果某人hg updates进行修订,则任何变为空的目录都会被自动删除.因此,如果您这样做:

Yes. Because mercurial doesn't track directories at all, only files, it only creates directories that have files in them, and if someone hg updates to a revision any directories that become empty are automatically removed. So if you do:

hg remove directory/*
hg commit -m 'removed all files in directory'
hg update -r 0   # updates to a different revision
hg update tip    # jump back to the tip

上次更新将删除目录.对于其他所有人,这甚至更加容易.当他们hg update对您的新更改进行更改时,它们的目录将消失(前提是它们中没有未提交的文件).

That last update would remove the directory. For everyone else it's even easier. When they hg update to your new changes their directory will just vanish (provided they have no uncommitted file in it).

这篇关于汞从回购删除目录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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