简体   繁体   English

当我没有 svn 凭据时,如何将 svn 存储库导出到 git?

[英]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.我在一个文件夹中完整检出了 svn 存储库。 But I don't have the credentials of the svn repository(hosted in Unfuddle).但我没有 svn 存储库(托管在 Unfuddle 中)的凭据。 I want to move this folder to a new git repostitory ( Github) with all its history and changes intact.我想将此文件夹移动到一个新的 git 存储库(Github),其所有历史记录和更改都完好无损。 If possible I would like to keep the commiters.如果可能的话,我想保留提交者。 How do I export my exiting svn folder to Github?如何将现有的 svn 文件夹导出到 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. SVN 结帐不包括它自己的历史记录,因此您所能做的就是将其视为一组正常的文件。

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

svn export will copy all the files except the hidden.svn directories. svn 导出将复制除 hidden.svn 目录之外的所有文件。 git commit -a will recursively add everything to change control and commit it. git commit -a 将递归添加所有内容以更改控制并提交。 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:要将其发布到 github,首先在 github 创建一个帐户,然后在 go 此处创建一个存储库:

http://help.github.com/create-a-repo/ 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假设您将其称为 test 并且您的帐户是 prabesh,所以它的全名是

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: 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它:

git remote add origin git@github.com:prabesh/test.git
git push -u origin master

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM