简体   繁体   中英

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.

I have an old copy of an svn repo (checked out from a repo that does no longer exist - server decommissioned a while ago). 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.

What I tried so far (but is not working) : Init a new git repo and try to convert existing repo to 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. There is no history information — it's all on the server.

You need a live server or a dump from svnadmin dump .

Working copy is not a repository clone. Subversion working copy does not contain revision history. 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.

  • In Subversion terms, the repository is a server-side database that is considered to be the single "source of truth". 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.

  • 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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