简体   繁体   English

将两个不同SVN存储库中的两个项目合并到一个存储库中

[英]Merging two projects in 2 different SVN repo to one of the repo

In one of my iPhone projects named Proj A, I worked on an SVN repo, say Repo A. And I had to do some R&D on the same project and so I took the source code and put it in a separate SVN repo Repo B. I had been working in Repo A and Repo B independently for around 10 months now. 在我的一个名为Proj A的iPhone项目中,我开发了一个SVN存储库(例如Repo A)。我必须在同一项目上进行一些研发,因此我将源代码放入单独的SVN存储库Repo B中。我已经分别在回购A和回购B中工作了大约10个月。 I have added new files in repo A and modified the existing files in repo B. Now I need to merge the source code in Repo A and Repo B to repo A. Is it possible to do this in SVN and if possible how shall I do this? 我在回购A中添加了新文件,并修改了回购B中的现有文件。现在,我需要将回购A和回购B中的源代码合并到回购A。是否可以在SVN中执行此操作,如果可能,我该怎么办这个?

You can not do it directly but below is the way that can do something in automated way. 您不能直接执行此操作,但是以下是可以自动执行操作的方法。

  1. Take checkout from Repo B. 从回购B结帐。
  2. Delete all SVN info from it. 从中删除所有SVN信息。 (Simple command line operation). (简单的命令行操作)。
  3. Take checkout from Repo A. 从回购A结帐。
  4. Overwrite all the code from Repo B to Repo A. 将所有代码从仓库B覆盖到仓库A。
  5. Sync it with server and it will show all the differences. 与服务器同步,它将显示所有差异。
  6. Merge them and commit. 合并并提交。

Hope it will help. 希望它会有所帮助。

I took the source code and put it in a separate SVN repo Repo B 我将源代码放入单独的SVN存储库Repo B中

How you done it is important: 如何做到这一点很重要:

If you used dump|load cycle and preserved UUID of RepoA in RepoB (check it with svn info in WCs of repos) you can 如果您使用了转储|加载周期并将RepoA的UUID保留在RepoB中(请在repos的WC中与svn info进行检查),则可以

  • relocate Working Copy of any repo to URL of another repo (another node, than changed code in repository-recipient, REPO/<some branch> will be good choice) 将任何存储库的工作副本重定位到另一个存储库的URL(另一个节点,而不是存储库收件人中更改的代码, REPO/<some branch>将是不错的选择)
  • merge two nodes in united repository 合并联合存储库中的两个节点

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM