After recent company changes, it is becoming clear we are migrating some of our SVN repos to git. A collegues was kind enough to push the current codebase up to the shared git space, but sadly the import process lost the full history.
I was sure this should already be a solved problem and after a little research I found svn2git.
This allows a really simple syntax - just navigate to a fresh folder and run the following
and watch your solution - every part of it - every commit gets streamed into the folder.
Then I started to process of uploading the lot. AFter setting up the repo on the new git remote server (blank of course) I added it to my local git directory
And then pushed to the new repo.
Looks good - until 20mins later I get an error.
It seems my full repo is over 100meg. It seems it didn’t want to work - so I tried the following….
But I got the error again:
It seems that between the server and the network I was using - somethign was stopping the repo being uploaded. I realised that the repo wasn’t paticularly clean. Someone had been checking in IPAs, Zip files, PNGs - alot of dirty files that shouldn’t be there. I theorized that if I just fremove those files then it will allow me to commit - but it’s not a case of just swiping the files out. Git actually keeps a history of any file, so that it can be distrubuted with every instance of git. To wipe from the history I decided to use the BFG-Repo-Cleaner.
Drop the jar file into the solution folder and run it as follows.
Which helpfully told me…
Helpful. I ran this a few more times with various zip files, pngs that were never used, a storyboard that I didn’t need the history on and the pods directory (to do a directory use this:)
Eventually I got it under 70Meg and I tried once again to upload the git repo. This time I got a nice message telling me all the branches had been uploaded.