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

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


No. A git-svn clone converts the entire repository into git. SVN checkouts do not have the entire repository and so cannot be cloned from. This is the primary advantage of switching from SVN or CVS to a distributed system (like git).


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.


I assume you probably want to keep the history. However, in case you (or anyone else who stumbles on this page) doesn't need history, you can use the "export" feature as explained here: https://stackoverflow.com/a/419475/2437521.