有没有一种简单的方法可以清除多变的工件存储库?
有时,当我依赖大量外部库时,我必须返回到一个非常旧的分支。更新到当前分支会删除这些依赖项的源文件,但工件以及一些文件夹等仍保留在那里。
我希望有一种方法可以强制 Mercurial 存储库就像我刚刚从远程(主)存储库克隆它一样。我不想只是破坏我的存储库并重新克隆它,因为这迫使我从远程服务器下载数百 MB 的数据。
Sometimes I have to return to a really old branch when I depended on a ton of external libraries. Updating to the current branch removes the source files for those dependencies, but the artifacts are left there, as well as a few folders and such.
I would like to have a way to force a mercurial repo to be as if I had just cloned it from the remote (master) repository. I don't want to just nuke my repo and re-clone it, because that forces me to download hundreds of MB from the remote server.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
为什么不从远程服务器克隆,而是从本地存储库克隆?之后,您可以使用旧的未跟踪文件来破坏您的存储库。
之后,您可以将新存储库映射到
hgrc
文件中的远程服务器Why don't you clone not from remote server, but from your local repository? After that you could nuke your repo with old untracked files.
After this you could map your new repo to your remote server in
hgrc
file您可以使用清除扩展,或者如果您使用的是类 UNIX 系统:
hg st -nu0 | xargs -0 rm
。You can use the purge extension, or if you are on an UNIX-like system:
hg st -nu0 | xargs -0 rm
.