gpt4 book ai didi

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

转载 作者:太空狗 更新时间:2023-10-29 13:31:04 24 4
gpt4 key购买 nike

我有一个文件夹中的 svn 存储库的完整 check out 。但我没有 svn 存储库(托管在 Unfuddle 中)的凭据。我想将此文件夹移动到一个新的 git repostitory (Github),其所有历史和更改都完好无损。如果可能的话,我想保留提交者。如何将现有的 svn 文件夹导出到 Github?

最佳答案

SVN checkout 不包含它自己的历史记录,因此您所能做的就是将其视为一组普通文件。

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

svn export 将复制除 stash 的 .svn 目录之外的所有文件。 git commit -a 将递归地添加所有内容以更改控制并提交它。当然,系统会提示您提供提交说明。

要发布到github,首先在github上创建一个账号,然后到这里创建一个仓库:

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

假设您将其命名为 test 并且您的帐户是 prabesh,那么它的全名是

git@github.com:prabesh/test.git

当你创建一个 repo 时,要做什么的完整细节会显示在 github 上,但是一旦你的 repo 存在,你可以通过注册远程 (github) repo 并推送你的本地 svn 导出的 git repo 上传到 github本地副本:

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

关于git - 当我没有 svn 凭据时,如何将 svn 存储库导出到 git?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6702806/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com