从svn迁移到git并保留svn-externals [英] Migrate from svn to git keeping svn-externals

查看:275
本文介绍了从svn迁移到git并保留svn-externals的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在从svn存储库迁移到git. 该svn信息库具有svn-externals,将保留在svn信息库中.这些外部版本在历史记录中进行了版本控制和标记,并且是只读的. 如何正确迁移并正确设置新git存储库中的svn-externals?

I am migrating from an svn repository to git. This svn repository has svn-externals, to be kept on svn repositories. These external are versioned and tagged in the history, and are read only. How I can properly migrate and have the svn-externals in the new git repository properly set?

我正在寻找"git svn propset",git子模块,子树合并.但是,如何建立这样的存储库呢?

I am looking in "git svn propset", git submodules, subtree merges. But How I can set up such a repository?

推荐答案

或者,我建议: 使用这个简单的旧python脚本的修改版本,该脚本可以正常工作: https://github.com/eneroth/git-externals 该脚本将检出先前在.gitexternals文件的子目录中定义的所有svn:externals 问题是检出的版本是HEAD,而不是git存储库的一部分

Alternatively, I propose: Use a modified version of this simple old python script, that works: https://github.com/eneroth/git-externals This script would check out all svn:externals previously defined in subdirectory in a .gitexternals file Problem is the checked out version is the HEAD, and are not part of the git repository

我将使用一个单独的文件来存储所有svn版本.该文件将存储在git中.因此,每次我们进行更新时, 该文件将使用最新提交的内容进行更新.脚本中的一个选项将允许将此文件更新为最新的外部版本. 该脚本将被修改以下载存储在该文件中的版本. 在这种情况下,分支和标签的外部版本也将固定. 对于迁移的历史数据,不确定这种方法是否行得通.

I would use a separate file, to use to store all svn versions. This file would be stored in git. So each time we do an update, This file would be updated with the latest commited. An option in the script would allow to update this file to the latest version of externals. The script would be modified to download the version stored in such file. Branches and tags would have the version fixed for externals as well in this case. For the historical data of the migration, not sure if this approach would work.

对于子模块,我也会使用此脚本,它非常灵活.但是在那种情况下,我们将所有外部都镜像到git

I would use this script in the case of submodules as well, it’s quite flexible. But in that case we will have all externals mirrored in git

这篇关于从svn迁移到git并保留svn-externals的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆