Subversion - 删除/清除并重新提交所有文件
所以,基本上,我有一大堆代码想要添加到 subversion 中。问题是我们已经有这个项目的存储库,其中包含旧代码。
现在我想将我当前的代码库添加到其中 - 以“重新开始”。我不想向当前项目添加源代码管理,因为我不希望它下载旧代码的最新版本。
因此,我需要删除或清除当前存储库,将源代码管理添加到包含新代码的文件夹中,然后提交所有这些文件。
我该怎么做?我可以通过 ssh 访问带有 subversion 的服务器,并使用 svn+ssh 连接(通过 Coda)。
谢谢
ps:我不知道最好在哪里发布这个。如果您愿意,请随意迁移到更好的网站。
So, basically, I've got a load of code that I want to add to subversion. The problem is that we have a repo for this project already, with old code in it.
Now I want to add my current code base to it - to "start again" as it were. I don't want to add source control to my current project because I don't want it to download the latest version of the old code.
So, I need to delete or clear my current repository, add source control to the folder with the new code in it and commit all those files.
How can I do this? I have ssh access to the server with subversion on it and am connecting (through Coda) using svn+ssh.
Thanks
ps: I couldn't figure out where was best to post this. Feel free to migrate to a better site if you think.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可以删除现有存储库的内容而不将其签出。从命令行,我首先获取项目根目录下的文件/目录列表:
然后删除它们(确保指定日志消息):
或者,您也可以删除主目录(传统上称为“trunk”)并重新创建它:
无论哪种方式,您最终都会得到一个空的 trunk 目录,您可以快速检出该目录并将文件添加到其中。
You can delete the contents of the existing repository without checking it out. From the command line, I'd first get a list of the files/directories at the root of your project:
Then delete them (making sure to specify a log message):
Or, alternatively, you can delete the main directory (traditionally called "trunk") and recreate it:
Either way, you'll end up with an empty trunk directory that you can check out quickly and add your files to.
将旧代码移至
legacy
分支,删除trunk
中的所有内容,然后在其中导入代码。Move old code to a
legacy
branch, delete everything fromtrunk
and import code there.我无法想象你为什么要这样做,但如果我想解决这个问题,我将使用 SmartSVN:
I can't imagine why you want do this, but if i want to solve this problem i will use SmartSVN for :