我正在将我们所有的项目从Subversion移到Git。对于不需要保留任何分支的项目,我成功地使用了git-svn,故意忽略了所有分支和标记。
我现在使用的是svn2git (a.k.a )的"KDE版本“。svn-all-fast-export)在两个Svn repos上工作,其中分支必须向前推进。
为了准备转换,我创建了一个dmp文件:
svnadmin create /opt/csvn/data/repositories/svnrepo
svnrdump https://<serverurl>/svn/thisproject > svn.dump # Has branches, tags, trunk structure
svnadmin load /opt/csvn/data/repositories/svnrepo < svn.dump我的svn列表file:///opt/csvn/data/repositories/v2_cleaned/按预期显示目录分支、标记和主干。
我的规则文件:
create repository testrepo
end repository
match /trunk/
repository testrepo
branch master
end match
match /branches/manufacturing/
repository testrepo
branch manufacturing
end match
# Ignore all other directories
match /
end match然后,我从一个包含其他工作存储库(包括svn2git &kde-规则集)的目录中运行转换:
./svn2git/svn-all-fast-export --debug-rules --identity-map=./Authors.map --rules=./Conversions/v2togit/rules-file --stats --add-metadata /opt/csvn/data/repositories/svnrepo/转换完成得非常快,不到一分钟.
我的问题:
如果我cd进入testrepo目录并运行"git分支“,它将显示*master和fine,根据我上面的规则文件,这似乎很好。
但是,如果运行"git状态“或"git签出制造”,我将收到以下消息:
fatal; this operation must be run in a work tree查看存储库的目录树,没有.git目录,“主干”的预期文件和目录也不存在。另外,当比较其他Git存储库的内容时,"good“.git目录的内容似乎出现在该目录的顶层。
我尝试手动创建.git,并将内容移动到其中,以匹配“好”的回复,但这并没有帮助。
我似乎错过了一步,或者也许我没有用正确的咒语调用svn-全速导出。
版本信息:
这些迁移都是一次转换,没有兴趣支持我读过的Svn或Git工作流(我已经做了足够多的噩梦了)。
提前谢谢你。
发布于 2022-06-16 23:56:14
听起来像是在工具生成的裸存储库上操作。
首先尝试使用git clone /path/to/your/output/testrepo testrepo-working_dir并使用克隆的存储库。
https://stackoverflow.com/questions/72619835
复制相似问题