简体   繁体   English

将SVN存储库主干链接为Git存储库子文件夹的分支

[英]Linking SVN repository trunk as branch for Git repository subfolder

I have open source project in Git repository. 我在Git仓库中有开源项目。 In the project, I'm using source code of another open source project. 在项目中,我正在使用另一个开源项目的源代码。 That code is stored in Git repository subfolder. 该代码存储在Git存储库子文件夹中。 I'd like to add the SVN repository [interested in trunk only] as a branch, but only for that specific Git subfolder. 我想添加SVN存储库[仅对trunk感兴趣]作为分支,但仅限于特定的Git子文件夹。

Note that I have modified the code of the other project, so I'm not looking for simple 1:1 copy. 请注意,我已经修改了其他项目的代码,所以我不是在寻找简单的1:1副本。 I just want to have an option to merge changes from the SVN to my Git repository, when I decide to do so. 当我决定这样做时,我只想选择将SVN中的更改合并到我的Git存储库中。 I will NOT need to commit back to SVN. 我不需要回到SVN。

I've found How to use git-svn to checkout only trunk and not branches and tags? 我发现如何使用git-svn只检查主干而不是分支和标签?

But I do not know how to link it to a subfolder only. 但我不知道如何仅将其链接到子文件夹。

  • Convert subfolder or wrapper git-repo into submodule or subtree 将子文件夹或包装器git-repo转换为子模块或子树
  • Link nested repo (I may be wrong in case of subtree technique) with SVN-repo using git-SVN 使用git-SVN链接嵌套repo(在子树技术的情况下我可能是错的)和SVN-repo

It looks like that you want to implement a vendor branch. 看起来您想要实现供应商分支。 For example, see this thread How do I import a third party lib into git? 例如,请参阅此主题如何将第三方库导入git? .

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

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