如何在 svn 中暂时将单个文件回滚到已知的良好状态?

发布于 2024-08-22 18:42:07 字数 634 浏览 1 评论 0原文

我目前正在尝试将单个文件返回到 subversion 中先前修订版的状态。我不想提交该文件,只需将其保留为对工作副本的修改即可。我该怎么做呢?

编辑: 有人建议我使用 checkout,但如果我运行我期望工作的命令,我会得到:

$ svn help checkout
checkout (co): Check out a working copy from a repository.
usage: checkout URL[@REV]... [PATH]


Valid options:
  -r [--revision] arg      : ARG (some commands also take ARG1:ARG2 range)
                             A revision argument can be one of:
                                NUMBER       revision number

$ svn checkout -r 133 templates/supplier.post_product.tpl
svn: Client error in parsing arguments

我想也许我必须使用目录的 url 而不是路径?

I'm currently trying to return a single file to the state of a previous revision in subversion. I don't want to commit the file, just leave it as a modification to the working copy for a bit. How would I do that?

Edit:
It was suggested that I use checkout, but if I run the command that I would expect to work I get:

$ svn help checkout
checkout (co): Check out a working copy from a repository.
usage: checkout URL[@REV]... [PATH]


Valid options:
  -r [--revision] arg      : ARG (some commands also take ARG1:ARG2 range)
                             A revision argument can be one of:
                                NUMBER       revision number

$ svn checkout -r 133 templates/supplier.post_product.tpl
svn: Client error in parsing arguments

I guess perhaps I have to use a url to a directory instead of a path?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

嘿咻 2024-08-29 18:42:07
svn up -r foo path/bar
svn up -r foo path/bar
情定在深秋 2024-08-29 18:42:07

您可以单独签出文件的旧版本,无需提交。

You can individually checkout the older revision of the file, no commit necessary.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文