svn有一个`revert-all`命令吗? [英] Does svn have a `revert-all` command?

查看:228
本文介绍了svn有一个`revert-all`命令吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我想丢弃所有的更改,并返回到存储库中的代码,我执行以下操作:

If I want to throw away all of my changes, and return to the code that is on the repository, I do the following:

$ rm -fr *
$ svn up

但我想知道是否有一个命令可以实现这一点,像:

This is easy enough, but I'm wondering if there is a single command that will accomplish this, something like:

$ svn revert-all


推荐答案

您可以:

svn revert -R .

这不会删除任何不受版本控制的新文件。但你可以很容易地编写一个shell脚本来做这样的:

This will not delete any new file not under version control. But you can easily write a shell script to do that like:

for file in `svn status|grep "^ *?"|sed -e 's/^ *? *//'`; do rm $file ; done

这篇关于svn有一个`revert-all`命令吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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