SVN删除已删除

发布于 2024-08-21 10:54:40 字数 248 浏览 3 评论 0原文

如何删除已被其他人从 svn 存储库(服务器)中删除的文件和目录(从我的本地副本)?

我想保持我的更改(和添加的文件)不变。我所说的“我的更改”是指我添加了一些新文件,但它们尚未在 svn 下(它们的状态为“?”)。

执行“svn update”和“svn stat”后,我得到了前缀为“?”的文件列表。 - 这些文件是我的更改与已删除的文件混合在一起。

有什么办法可以删除那些“已删除”的文件吗?如果它们不是我修改的,最好删除它们。

How can I remove files&directories (from my localcopy) that have been already removed from svn repository (server) by somebody else?

I'd like to keep my changes (and added files) untouched. And by "my changes" I mean that I have added some new files but their are not yet under svn (their have the "?" status).

After performing "svn update" and "svn stat" I get a list of files that prefixed with "?" - those files are my changes mixed with deleted files.

Is there any way to remove those "deleted" files? It would be nice to delete them only if they are not modified by me.

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

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

发布评论

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

评论(2

深者入戏 2024-08-28 10:54:40

我建议不要在这里尝试提出脚本解决方案;最安全的做法是检查每个文件并确定是否需要保留。

您应该能够通过查看先前的修订版本并查看文件是否存在来判断哪些文件是新的,哪些是以前在存储库中的。

I recommend not trying to come up with a scripting solution here; the safest thing to do is inspect each file and determine if it needs to be kept or not.

And you should be able to tell which files are new and which were previously in the repository just by looking at prior revisions and seeing if the file exists.

囚你心 2024-08-28 10:54:40

将修改后的文件添加到 svn

然后列出所有状态,找到所有带有“?”的文件状态并删除它们。

svn status | grep ^? | xargs rm -v

诀窍是将所有新文件置于版本控制之下,然后删除“已删除文件”就很容易了。

Add your modified files to svn

then list all the statuses, find all that have "?" state and delete them.

svn status | grep ^? | xargs rm -v

The trick is getting all your new files under version control, deleting the "deleted files" is then easy.

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