git - 恢复 git-svn 克隆

标签 git git-svn

我开始使用 git-svn 的克隆操作克隆一个 SVN 存储库。导入大约 6 小时后(这是一个很大的 repo ),我的电脑跑到我身上 sleep 了。有没有办法在不重做所有初始工作的情况下恢复操作?

最佳答案

用于恢复 git svn clonegit svn fetch 命令已被多个来源证实:

(Incidentally, if during the initial clone step your connection dies or you need to stop it then to resume the clone you just have to run the above command to resume downloading the history).

There seems to be a memory leak in git-svn. The size of the git-svn process grew slowly and after about two weeks it was at 1.2 GB resident size, at which point the OS refused to let it fork.
Thing is, this was a blessing in disguise.
I was able to resume the interrupted clone with a simple "git svn fetch", and it ran much faster with the now radically smaller heap.
This, worked so well, in fact, that I got into the habit of interrupting and restarting the process every evening and every morning. A few days later it was done.

You start your adventures with git-svn by cloning an existing Subversion repository:

git svn clone url://path/to/repo -s

The -s flag assumes that your repository uses the "trunk, branches, tags" convention. If not, you have to specify manually which directories represent branches and tags, if you want Git to know about them.

This will take a long time, as it will fetch every single revision from SVN and commit locally. If for any reason it stops, you can resume with git svn fetch.

关于git - 恢复 git-svn 克隆,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2676912/

相关文章:

git - 如何仅列出两次提交之间更改的文件名

git - 将文件重置为特定提交的命令是什么?

git - "Peer' s 证书颁发者在 Openshift3 中已被标记为不被用户信任

svn - Mac 上的版本控制

git - 网络启动 SSHD HELPMSG 3534

Git:从错误的分支创建新分支

git - 设置 http.sslCAInfo 后无法克隆 Github 存储库

Git - 在 git-svn clone 之后删除远程分支

git - 忽略 git 中已修改(但未提交)的文件?

git - 将具有重命名中继历史记录的 SVN 存储库导入 Git