Incremental Migration from SVN to Git

我是研究僧i 提交于 2019-12-12 01:27:59

问题


Consider my below scenario :

Suppose my svn repository contains 100 revisions, which has been migrated to Git Repository (So my Git contains the 100 revisions).

Now my svn repository got updated, say with 5 more revisions hence it has 105 revisions. How do i migrate only the revisions 101 t0 105 to my GIT repository?

The main challenges I have :

  1. I dont want to sync both SVN and Git.(SVN will be decommisioned soon)
  2. I need to migrate the Revisions with its history.

I tried following up with these links which dont help me,(fyi)

  1. Using svnsync

  2. USing git svn clone


回答1:


Use git-svn. When you do initial clone git svn clone ... you will get the first 100 revisions. Later you do git svn fetch which would fetch the newly appeared 5 revisions.

All 105 revisions will be present in a correct order thus the history will be preserved.

Update:

If you wish to avoid getting first 100 revisions, do git svn init with fetch initially:

git svn init ...
git svn fetch -r <svn revision you want to start from>


来源:https://stackoverflow.com/questions/29161646/incremental-migration-from-svn-to-git

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!