简体   繁体   中英

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. 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:

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;

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.

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. 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. 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.

Any tips welcome, I'm baffled at the minute and no idea where to go next.

Thanks, Keegan

After your first import, try this: git svn rebase

But, the best approach, if you svn repository is really big (more than 1GB), is avoid to import all the revisions. 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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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