Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/svn/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
git svn克隆忽略文件_Git_Svn_Git Svn - Fatal编程技术网

git svn克隆忽略文件

git svn克隆忽略文件,git,svn,git-svn,Git,Svn,Git Svn,我试图使用Atlassian教程()将我的svn存储库迁移到git存储库,但未能正确签出我的svn存储库。克隆后,它拥有使用git log时可用的所有历史记录,但我看不到任何文件。我尝试使用git checkout-b trunk remotes/trunk签出其中一个远程分支,但在新创建的分支主干上仍然没有文件 迁移脚本的开头如下所示: #!/bin/sh #$1 - remote svn repo #$2 - local git repo name java -jar svn-migrati

我试图使用Atlassian教程()将我的svn存储库迁移到git存储库,但未能正确签出我的svn存储库。克隆后,它拥有使用
git log
时可用的所有历史记录,但我看不到任何文件。我尝试使用
git checkout-b trunk remotes/trunk
签出其中一个远程分支,但在新创建的分支主干上仍然没有文件

迁移脚本的开头如下所示:

#!/bin/sh
#$1 - remote svn repo
#$2 - local git repo name
java -jar svn-migration-scripts.jar authors $1 > authors.txt
git svn clone --stdlayout --authors-file=authors.txt $1 $2
* branches
  * as usual...
* tags
  * as usual...
* trunk
  * src
    * src
    * pom.xml
我的发现

我可以使用git svn命令获得没有历史记录的文件:

git svn clone -rHEAD $1 $2
使用此命令签出的文件将具有类似svn的结构(
trunk
branchs
),因此这不是我要查找的

再试一次…

我试过使用GitHub中的
svn2git
,但它使用的机制相同,所以也失败了。。。命令:

svn2git https://svn/xxx --trunk trunk/src --branches branches --notags --authors ../authors.txt 
输出:

Checked out HEAD:
https://svn/xxxx r149793
仍然没有文件,只有
.git
文件夹。我试过去拿、拉等

另一个有趣的观察结果

我发现了一个奇怪的存储库。有如下文件夹结构:

#!/bin/sh
#$1 - remote svn repo
#$2 - local git repo name
java -jar svn-migration-scripts.jar authors $1 > authors.txt
git svn clone --stdlayout --authors-file=authors.txt $1 $2
* branches
  * as usual...
* tags
  * as usual...
* trunk
  * src
    * src
    * pom.xml
结果如下:

svn2git https://svn/xxx --trunk trunk
svn2git https://svn/xxx --trunk trunk/
不起作用

svn2git https://svn/xxx --trunk trunk/src

工作。这至少很奇怪。

我不知道问题的确切原因,但这与我的git版本有关。我在Ubuntu上使用过git 1.9,但失败了,但在OSX版本的git(1.8)上,同样的命令也能工作。如果您偶然发现了这样的问题,请尝试使用其他版本的git

我用于迁移的脚本(
svn migration scripts.jar
是从Atlassian教程下载的jar)


我希望有人会觉得它有帮助。

奇怪,从来没有这样的问题。是否使用远程回购的中继?它应该包含任何文件吗?您可以更改分支吗(
git checkout-b
正在从当前分支创建一个新分支)。我可以更改分支,但每个分支都是空的(尽管它的日志是正确的)。问题是否由svn上的路径引起?我试着从其他路径检查其他项目,它成功了。。。