如何git-svn克隆Subversion版本库中的最后n个版本? [英] How to git-svn clone the last n revisions from a Subversion repository?
问题描述
如何使用Subversion存储库中的git-svn创建浅拷贝,例如
git clone 命令可以从a中得到最后n个修订版本Git仓库,如果你使用 - depth
选项,即得到仓库的浅表副本。例子:
git clone --depth 3 git:// some / repo myshallowcopyrepo
git-svn是否有类似的选项?
我的发现如此远 到目前为止,我只找到 根据文档可以使用 文档 例如: Git的数据结构基于有向无环图(DAG)中的指针,这使得返回 Problem How do you create a shallow copy with git-svn from a Subversion repository, e.g. how do you pull only the last three revisions? The Is there a similar option for git-svn? My discoveries so far So far I've only found the According to the documentation there is the possibility to use So I replaced Documentation You've already discovered the simplest way to specify a shallow clone in Git-SVN, by specifying the SVN revision number that you want to start your clone at ( For example: Git's data structure is based on pointers in a directed acyclic graph (DAG), which makes it trivial to walk back 这篇关于如何git-svn克隆Subversion版本库中的最后n个版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
-rN
选项,其中 N
是拉动的修改。例子:
git svn clone -rN svn:// some / repo
-r $ REVNUMBER:HEAD
。我尝试了以下获得最后3个修订,它们返回了错误信息。
$ git svn clone --prefix = svn / -s -rHEAD〜3:HEAD http:// some / svn / repo。
修订参数:HEAD〜3:HEAD不能被git-svn所理解
HEAD〜3
与第三个但最后一个修订版534的实际数量相同。这很有效,但这需要我先计算出第三个修订版本号,但最后一个提交。 / p>
$ git svn clone --prefix = svn / -s -r534:HEAD http:// some / svn / repo。
$ b $ git svn clone -s -r1450:HEAD some / svn / repo
n
提交变得微不足道。但是在SVN中(因此在Git-SVN中),您必须自己找到修订版本号。git clone
command can get the last n revisions from a Git repository if you use the option --depth
, i.e. you get a shallow copy of the repository. Example:git clone --depth 3 git://some/repo myshallowcopyrepo
-rN
option where N
is the revision to pull. Example:git svn clone -rN svn://some/repo
-r$REVNUMBER:HEAD
. I tried the following to get the last 3 revisions which returned an error message.$ git svn clone --prefix=svn/ -s -rHEAD~3:HEAD http://some/svn/repo .
revision argument: HEAD~3:HEAD not understood by git-svn
HEAD~3
with the actual number of the third but last revision 534. That worked, but that requires me to first figure out the revision number of the third but last commit.$ git svn clone --prefix=svn/ -s -r534:HEAD http://some/svn/repo .
-r$REV:HEAD
). git svn clone -s -r1450:HEAD some/svn/repo
n
commits. But in SVN ( and therefore in Git-SVN) you will have to find the revision number yourself.