1

I have what should be a svn repo. in a local folder in my computer. I don't know if it is possible but I would like to convert it so it uses git only. I no longer have access to the svn server and all there inside the .svn folder is

all-wcprops
entries
format
prop-base
props
text-base
tmp

I have tried doing svn log but it starts asking for credentials. I have also tried verifying that it is an svn repo by doing something like svnadmin verify /folder but all it says is svnadmin: Can't open file 'format': No such file or directory. All I need is the commit history.

ThatBlairGuy
  • 2,426
  • 1
  • 19
  • 33
alexdmejias
  • 1,399
  • 4
  • 19
  • 34
  • 2
    AFAIK history is stored on the central SVN server, if you've lost access to it, you no longer have the history. This is one reason why DVCSs are better than SVN, all developers have a copy of the full history that can be used as backups in case of some kind of failure. – Robert Rouhani Mar 25 '13 at 20:32
  • [This question](http://stackoverflow.com/questions/13574743/does-the-svn-1-7-working-copy-format-store-the-entire-history-of-the-repo) indicates as much. So it seems that, given your loss of access to the central repo, you no longer have commit history and will have to start fresh with git. – ajp15243 Mar 25 '13 at 20:38
  • Terminology-wise, what you actually have is an svn _working copy_. This is not at all the same thing as a repository. The repository is what was stored on the svn server. The information you're looking for is not available in the working copy. – ThatBlairGuy Mar 25 '13 at 21:16

3 Answers3

3

If this is the repository (not a local workspace), use git svn clone to slurp it into a newly created git repository. Check the result 5 ways through Sunday, ditch the SVN to a nice, cosy CD/DVD for safekeeping.

Note that git svn clone can take a very long time, as it sequentially asks SVN to recreate each sigle revision there ever was, and then integrates that as a commit. SVN is inefficient when digging up old stuff, and the handling by git svn isn't precisely stellar either. For a not-so-large, remote SVN repo it can well take a day or two. I had to restart such several times, as the connection broke. I don't remember if the right incantation was git svn clone again or git svn rebase, or something else (yes, it is scary seeing an empty clone repository, but the downloaded stuff is there).

vonbrand
  • 11,412
  • 8
  • 32
  • 52
1

If you don't mind losing history (as I mentioned in my comment, if you don't have access to the central server, you don't have access to the history), you can init a git repo in the same folder, add a .gitignore file with all the files/folders you usually ignore in SVN in addition to the line .svn/, to ignore the .svn folders, then add/commit everything.

With command line git, this would look like:

cd path/to/repo
git init
touch .gitignore
#EDIT THE .gitignore FILE HERE
git add .
git commit -m "Initial commit"

If you want to clean out the .svn folders later, you can either use the link in werd's answer or clone the repo to another folder.

Community
  • 1
  • 1
Robert Rouhani
  • 14,512
  • 6
  • 44
  • 59
-4

1) Remove .svn/ folders - http://www.anyexample.com/linux_bsd/bash/recursively_delete__svn_directories.xml

2) Add it to GIT repo

werd
  • 648
  • 4
  • 13
  • 23