Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how do I export svn repository to git when I don't have svn credential?

I have a full checkout of svn repository in a folder. But I don't have the credentials of the svn repository(hosted in Unfuddle). I want to move this folder to a new git repostitory ( Github) with all its history and changes intact . If possible I would like to keep the commiters . How do I export my exiting svn folder to Github ?

like image 924
Prabesh Shrestha Avatar asked Jan 20 '23 05:01

Prabesh Shrestha


1 Answers

An SVN checkout does not include it's own history, so all you can do is treat it as a normal set of files.

git init newgit
svn export yourcheckout newgit
git commit -a newgit

svn export will copy all the files except the hidden .svn directories. git commit -a will recursively add everything to change control and commit it. You'll be prompted for a commit note, of course.

To publish it to github, first create an account at github, then go here to create a repository:

http://help.github.com/create-a-repo/

Let's say you called it test and your account is prabesh, so it's full name is

[email protected]:prabesh/test.git

The full details of what to do are shown on github when you create a repo, but once your repo exists, you can upload your local svn exported git repo to github, by registering the remote (github) repo, and pushing your local copy to it:

git remote add origin [email protected]:prabesh/test.git
git push -u origin master
like image 72
memetech Avatar answered Jan 27 '23 05:01

memetech