删除 Bazaar 中的未知文件
我的 Bazaar 工作树中有一堆我不再需要的未知文件。我可以使用 bzr stat 获取它们的列表,但我想要一种简单的方法来摆脱它们。 (我希望 bzr revert 的选项可以做到这一点,但我没有找到。)
我总是可以编写一个小脚本来解析 bzr stat 的输出> 和 rm
或 mv
未知,但我认为某些东西可能已经存在。
我有 Bazaar (bzr
) 1.13.1。
I have a bunch of unknown files in my Bazaar working tree that I no longer want. I can get a list of them using bzr stat
, but I'd like an easy way to get rid of them. (I'd expect an option for bzr revert
to do this, but I'm not finding one.)
I can always write a tiny script to parse the output of bzr stat
and rm
or mv
the unknowns, but I thought something might already exist.
I have Bazaar (bzr
) 1.13.1.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
bzr clean-tree
将删除工作树中的所有未知文件。它还具有用于删除忽略文件、合并备份和其他类型不需要的文件的开关。请参阅bzr clean-tree --usage
了解完整详细信息。编辑添加:对于 Bazaar 2.0.0 来说是这样,我不确定 1.13 是否如此
bzr clean-tree
will get rid of all unknown files in a working tree. It also has switches to remove ignored files, merges backups and other types of unwanted files. Seebzr clean-tree --usage
for full details.Edit to add: This is true for Bazaar 2.0.0, I'm not sure about 1.13
制作了一个脚本:
我只测试了一点,但它似乎工作得很好。如果您通过评论发现问题,请告诉我。
在一个单独的主题上,我应该学习 sed 和 sed 吗? awk?我倾向于使用 ruby -e "some ruby code" 来编写这些东西。
Made a script:
I've only tested it a little, but it seems to work just fine. Please let me know if you find an issue via the comments.
On a separate topic, should I learn
sed
&awk
? I tend to write these things usingruby -e "some ruby code"
.