开发者

Using git svn can I import to git repository last 100 revisions?

I am trying to clone big svn repository to my g开发者_开发知识库it repository. The problem is that rep. is too big and svn clone works too slow. Is there way to clone only last N revisions?

Something like that:

git svn clone http://svn/svn/test . (from 200 to 400 revision)

or maybe something like that:

git svn fetch (20,30,40-50 revisions)


If it were a git repo, you could

git svn clone (url) --depth (N)

But it is non-trivial in SVN to find the revision number of "N revisions back", unlike in Git.

So, you have to specify the revision number of the SVN yourself.

Alex has provided the right syntax.

git svn clone -s -r534:HEAD http://some/svn/repo

But it is easier on your head to remember and do the following:

# checkout a specific revision
git svn clone -r N svn://some/repo/branch/some-branch
# enter it and get all commits since revision 'N'
cd some-branch
git svn rebase


Specify the SVN revision number that you want to start your clone at with the -r switch. -r$REV:HEAD.

Something like this:

 git svn clone --prefix=svn/ -s -r$REV:HEAD path/to/repo

Where $REV is the revision number you wish to start the clone at.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜