Subversion - 删除/清除并重新提交所有文件

发布于 2024-11-24 19:34:35 字数 318 浏览 4 评论 0原文

所以,基本上,我有一大堆代码想要添加到 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 技术交流群。

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

发布评论

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

评论(3

纵性 2024-12-01 19:34:35

您可以删除现有存储库的内容而不将其签出。从命令行,我首先获取项目根目录下的文件/目录列表:

svn ls svn+ssh://repourl/path/to/your/project/trunk

然后删除它们(确保指定日志消息):

svn rm -m "Delete old files" \
       svn+ssh://repourl/path/to/your/project/trunk/file1 \
       svn+ssh://repourl/path/to/your/project/trunk/file2 \
       svn+ssh://repourl/path/to/your/project/trunk/dir1 \

或者,您也可以删除主目录(传统上称为“trunk”)并重新创建它:

svn rm -m "Delete old files" svn+ssh://repourl/path/to/your/project/trunk
svn mkdir -m "Recreate trunk" svn+ssh://repourl/path/to/your/project/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:

svn ls svn+ssh://repourl/path/to/your/project/trunk

Then delete them (making sure to specify a log message):

svn rm -m "Delete old files" \
       svn+ssh://repourl/path/to/your/project/trunk/file1 \
       svn+ssh://repourl/path/to/your/project/trunk/file2 \
       svn+ssh://repourl/path/to/your/project/trunk/dir1 \

Or, alternatively, you can delete the main directory (traditionally called "trunk") and recreate it:

svn rm -m "Delete old files" svn+ssh://repourl/path/to/your/project/trunk
svn mkdir -m "Recreate trunk" svn+ssh://repourl/path/to/your/project/trunk

Either way, you'll end up with an empty trunk directory that you can check out quickly and add your files to.

中性美 2024-12-01 19:34:35

将旧代码移至 legacy 分支,删除 trunk 中的所有内容,然后在其中导入代码。

Move old code to a legacy branch, delete everything from trunk and import code there.

青朷 2024-12-01 19:34:35

我无法想象你为什么要这样做,但如果我想解决这个问题,我将使用 SmartSVN:

  1. 删除旧项目的文件夹(存储库 -> 在存储库浏览器中打开)。
  2. 导入到存储库新版本(项目 -> 导入到存储库)。

I can't imagine why you want do this, but if i want to solve this problem i will use SmartSVN for :

  1. Delete folder with old project (Repository -> Open in Repository Browser).
  2. Import to repository new version (Project -> Import Into Repository).
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文