简体   繁体   English

如何将SVN存储库的本地克隆转换为git

[英]How can I convert a local clone of SVN repo to git

Although this sounds like a common question, I actually could not find any thread with the same issue I am having on #SO. 尽管这听起来像是一个常见问题,但实际上我找不到与#SO相同的线程。

I have an old copy of an svn repo (checked out from a repo that does no longer exist - server decommissioned a while ago). 我有一个svn存储库的旧副本(从不再存在的存储库中检出-服务器已在不久前停用)。 And I want to checkout commit history on that repo. 我想签出该存储库上的提交历史记录。 I figured since there is a ".svn" folder in the root of the repo with 65+M of data in it that it should be possible to do so. 我认为,由于存储库根目录中有一个“ .svn”文件夹,其中包含65 + M数据,因此应该可以这样做。

What I tried so far (but is not working) : Init a new git repo and try to convert existing repo to git 到目前为止我尝试过的(但不起作用):初始化一个新的git repo并尝试将现有的repo转换为git

# Init empty git repo git init git svn rebase -l

# Init git-svn repo rm -rf .git git svn init http://same/url/as/the/one/used/before/decommissioning/the/server git svn rebase -l

Is what I am trying to do even possible ? 我正在尝试做的甚至有可能吗? Is the data I am looking for even available offline ? 我正在寻找的数据甚至可以脱机使用吗?

I think this is impossible . 我认为这是不可能的 Local SVN checkout doesn't contain enough information to serve as a repository. 本地SVN结帐没有足够的信息来充当存储库。 There is no history information — it's all on the server. 没有历史信息-全部在服务器上。

You need a live server or a dump from svnadmin dump . 您需要实时服务器或svnadmin dump

Working copy is not a repository clone. 工作副本不是存储库克隆。 Subversion working copy does not contain revision history. Subversion工作副本不包含修订历史记录。 It is a lightweight local copy of your project and is not intended to be used to migrate revision history. 它是项目的轻量级本地副本,不能用于迁移修订历史记录。 You can import the working copy's data to new git repository, but it won't contain any history of changes. 您可以将工作副本的数据导入到新的git存储库,但其中不会包含任何更改历史记录。

  • In Subversion terms, the repository is a server-side database that is considered to be the single "source of truth". 用Subversion术语来说, 存储库是一个服务器端数据库,被认为是单一的“真理来源”。 It is a central storage which you access with a web browser to to view history of changes and use to checkout a working copy to work with the versioned data. 它是一个中央存储,您可以使用Web浏览器访问该中央存储以查看更改历史记录,并用于签出工作副本以使用版本控制的数据。

  • The working copy is a workbench for your work and changes. 工作副本是您进行工作和进行更改的工作台。 You use it to operate with the repository -- modify the data and commit the changes to the remote repository. 您可以使用它来操作存储库-修改数据并将更改提交到远程存储库。 Working copies are usually much smaller in size and usually faster to obtain than the repository itself because the contain only just one project's branch or trunk (ie master). 工作副本通常比存储库本身要小得多,而且获取副本的速度通常也更快,因为工作副本仅包含一个项目的分支或主干(即主副本)。 There can be as much working copies from the same repository or project as you want with any combination of modifications. 任意组合的修改,可以根据需要从同一个存储库或项目中获得尽可能多的工作副本。

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

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