|
ConvertingSvnToGit
Moving a project from using Subversion for code hosting to Git
git Convert your project from Subversion to GitFollow the following instructions to switch your project from Subversion to Git:
Your old Subversion project will still be accessible after you switch your project to using Git, so you will not need to back up your repository before switching. Your Subversion repository will remain accessible at: https://projectname.googlecode.com/svn/ Until you convert your old Subversion data to Git, your new repository and wiki will appear empty. (Don't worry, your old Subversion data is still there, and you can always switch back.) How to Convert Subversion History to GitFor both of these options, make sure you know your project's clone URL and familiarize yourself with the clone instructions on your project's Source Checkout page. You can get to this page by clicking the "Source" tab, or go directly to https://code.google.com/p/projectname/source/checkout You won't be using the git clone instructions exactly for this procedure, but you should be using that URL and username/password info. Option 1: Top-SkimmingIf you don't care about your project's history, then you can simply "top skim" the latest trunk code or wiki from Subversion and put it into Git. Assuming your googlecode Git repository is empty, it's as easy as: $ git clone https://code.google.com/p/projectname $ cd projectname $ svn export --force http://projectname.googlecode.com/svn/trunk . $ git add . $ git commit -m "Initial import of source." $ git push origin master To convert your wiki: $ git clone https://code.google.com/p/projectname.wiki $ cd projectname.wiki $ svn export --force http://projectname.googlecode.com/svn/wiki . $ git add . $ git commit -m "Initial import of wiki." $ git push origin master Option 2: Full History ConversionIf want to migrate your whole history, the process is much more involved. We will use a tool called git-svn, which is included in standard Git distributions. The steps below work best if you use the standard Google Code Subversion project layout, with /trunk, /branches, /tags, and /wiki directories. git-svn is a powerful tool that is capable of much more than the simple history conversion we will go through here. For more information, see the full documentation. Converting your history can be as simple as cloning the Subversion repo using the svn remote helper: $ git svn clone --stdlayout https://projectname.googlecode.com/svn projectname $ cd projectname $ git remote add googlecode https://code.google.com/p/projectname $ git push --all googlecode If your project has tags, you should also push those. The following will create a simple tag for every tag in the Subversion repo. If you want to create annotated tags, the procedure can be more complicated; see http://gitready.com/advanced/2009/02/16/convert-git-svn-tag-branches-to-real-tags.html for a brief example. $ git push googlecode refs/remotes/tags/*:refs/tags/* To convert your wiki history, use a similar approach (note the .wiki suffix): $ git svn clone https://projectname.googlecode.com/svn/wiki projectname.wiki $ cd projectname.wiki $ git remote add googlecode https://code.google.com/p/projectname.wiki $ git push --all googlecode You're done! If you look at at your project's Source or Wiki tabs, you should see your converted repository history. If you have trouble, feel free to contact google-code-hosting@googlegroups.com | |
The full history conversion instructions do not work.
If I try cd-ing to projectname first and then running this command it works but then the the push command doesn't:
The actual commands I ran contained my project name, obviously.
The "Cannot access URL" error is caused because git push requires an authenticated connection; there are 2 ways to do this. You can put your username in the URL like this
$ git remote add googlecode https://user@code.google.com/p/projectname
or you can add a line to your .netrc file.
I seeing below error:
$ git push --all googlecode error: SSL certificate problem, verify that the CA cert is OK. Details: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed while accessing https://code.google.com/p/drupalcamplagos/info/refs
fatal: HTTP request failed
Any ideas what could be wrong?
Works well, full history. Admin>Source>Git; then Option 2.
The link to the git-svn documentation is broken: http://www.kernel.org/pub/software/scm/git/docs/git-svn.html