开发者

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 th开发者_如何学Gois 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 ?


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

git@github.com: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 git@github.com:prabesh/test.git
git push -u origin master
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜