简体   繁体   English

Svn2Git-将大型GIT存储库推送到远程

[英]Svn2Git - Push Large GIT Repo To Remote

I'm currently trying to move our large Subversion repository, around 25GB including history, into GIT and I seem to have hit two issues. 我目前正在尝试将包括历史记录在内的大约25GB的大型Subversion存储库移至GIT中,我似乎遇到了两个问题。 One of which I think I've resolved, but I'll cover both for completeness in case I screwed up the first fix; 我认为我已经解决了其中一个问题,但是为了完整起见,我将同时介绍这两个问题,以防我搞砸了第一个修复程序。

The Subversion repository doesn't appear to follow a consistent pattern for branching, it looks like the pattern changed over the years, so to start with I used the rootistrunk option to get the whole repo to git: Subversion存储库似乎并没有遵循一致的分支模式,看起来这种模式多年来已经改变了,因此首先,我使用rootistrunk选项将整个存储库添加到git:

svn2git http://svnurl/repo --rootistrunk --authors authors.txt

This worked however the repo was then too large to push to remote and I received the following error; 这个工作正常,但是仓库太大了,无法推送到远程,我收到了以下错误; [remote rejected] master -> master (Maximum request length exceeded) [远程拒绝]主机->主机(超出最大请求长度)

To work around this I used the following method to get a chunk of the Subversion repo in the hope I could get 500 commits at a time and work around the large packing issue; 要解决此问题,我使用以下方法获取了Subversion存储库的一部分,希望我一次可以获取500次提交,并解决大包装问题。

svn2git http://svnurl/repo --rootistrunk --authors authors.txt --revision 1:500

I then pushed and it worked, I then ran git svn fetch -r 501:1000 to get the next 500 commits but when I try and push after this latest fetch I get a message saying "Everything up-to-date" despite the fact that can't be the case. 然后,我推送并成功运行,然后运行git svn fetch -r 501:1000以获取接下来的500次提交,但是当我尝试在最新获取后推送时,我收到一条消息,说“一切都是最新的”事实并非如此。

I've scoured the help files for git and svn2git in the hope I can find out what I've done wrong but after a few days of research I've still no solution, I'm a newbie to git so likely I've missed something obvious to an old hat. 我已经搜索了git和svn2git的帮助文件,希望能找出做错了什么,但是经过几天的研究,我仍然没有解决方案,我是git的新手,所以我很可能错过了一顶旧帽子明显的东西。 Can anyone shed any light on what I'm doing wrong please? 有人可以告诉我我在做什么错吗? If I've made a false assumption and I'm doing it all wrong I'd be happy to hear it as it wouldn't surprise me at this stage! 如果我做出了错误的假设,但我做错了所有事情,那么我很乐意听到它,因为在现阶段这不会令我感到惊讶!

I'm currently trying to push into a TFS 2013 project and a Stash repo, both show the same behaviour so I must have done something wrong on the GIT side. 我当前正在尝试进入TFS 2013项目和Stash存储库,两者都表现出相同的行为,因此我在GIT方面一定做错了。 The first push works in both cases, only the second that doesn't want to accept new files. 第一次推送在两种情况下均有效,仅第二次不想接受新文件。 The server I'm performing the push from runs Ubuntu, TFS is on Windows Server 2012 and Stash is on another Ubuntu box. 我正在执行推送的服务器运行Ubuntu,TFS在Windows Server 2012上,Stash在另一个Ubuntu盒子上。

Any tips welcome, I'm baffled at the minute and no idea where to go next. 任何提示都欢迎,我一时感到困惑,不知道下一步该怎么做。

Thanks, Keegan 谢谢,Keegan

After your first import, try this: git svn rebase 首次导入后,请尝试以下操作: git svn rebase

But, the best approach, if you svn repository is really big (more than 1GB), is avoid to import all the revisions. 但是,如果您的svn存储库确实很大(超过1GB),最好的方法是避免导入所有修订。 I would recommend to start from a more recent timeline and save a svn dump in safe place if some day you really want to look very old revisions. 我建议从较新的时间轴开始,如果有一天您真的想看很旧的修订,请将svn转储保存在安全的地方。

If you choose to import from a more recent timeline, the result is something like this: 如果您选择从最近的时间轴导入,则结果如下所示:

svn2git http://svnurl/repo --rootistrunk --authors authors.txt --revision 500:HEAD

When the first 500 commits are not pulled to git. 当前500次提交未拉到git时。

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

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