Search code examples
gitsvngit-svngit-checkoutsvn-checkout

Convert an SVN checkout to use git (git-svn)


I work with software that is kept in svn for version control. I would like to use git (git-svn) however the software requires lots of setup and configuration before it can be used. There are tools that take care of all of the setup, including checking out all the code via svn.

All the documentation for git-svn (I've been able to find) requires a fresh checkout, using git-svn.

Is there a way to convert an existing svn checkout so it can use git-svn?


Solution

  • You could do something like this:

    1. Do a full clone of your SVN tree using git-svn, to a temporary directory. Make sure you use the exact same revision as your existing checkout.
    2. Move the ".git" folder from the top level of the git-svn checkout into the top level of the SVN checkout.
    3. Then you'll either need to tell Git to ignore the ".svn" directories, or you can delete them all.
    4. Delete the git-svn checkout.
    5. There, now you can manipulate your existing files with Git and git-svn.
    6. Do a "git status" and hope that it says there are no changes.