简体   繁体   English

为什么git svn无法克隆裸仓库?

[英]Why git svn cannot clone a bare repo?

This issue is not the same as this or this . 此问题与此不同

git svn clone -s --bare https://ctags.svn.sourceforge.net/svnroot/ctags
Unknown option: bare

What is wrong? 怎么了?

Can I use git svn to clone a bare repo? 我可以使用git svn克隆一个裸仓库吗?

I have read man git-svn, and cannot find a method to clone a bare repo. 我读过man git-svn,找不到克隆裸仓库的方法。

Edit 1 编辑1

My tags on git svn repo: 我在git svn repo上的标签:

git branch -r
  origin/master
  tags/Ctags-5_1
  tags/Ctags-5_1_1
  tags/Ctags-5_2
  tags/Ctags-5_2_1
  tags/Ctags-5_2_2
  tags/Ctags-5_2_3
  tags/Ctags-5_3
  tags/Ctags-5_3_1
  tags/Ctags-5_4
  tags/Ctags-5_5
  tags/Ctags-5_5_1
  tags/Ctags-5_5_2
  tags/Ctags-5_5_3
  tags/Ctags-5_5_4
  tags/Ctags-5_6
  tags/ctags-5.7
  tags/ctags-5.8
  tags/test
  trunk

Why I cannot push these tags into the git repository? 为什么我不能将这些标签推入git存储库?

Found a better solution 找到更好的解决方案

$ git svn init https://ctags.svn.sourceforge.net/svnroot/ctags repo-git --stdlayout 
$ #edit  repo-git/.git/config to contain:
[svn-remote "svn"]
        url = https://ctags.svn.sourceforge.net/svnroot/ctags
        fetch = trunk:refs/heads/master
        branches = branches/*:refs/heads/*
        tags = tags/*:refs/tags/*
$ cd repo-git
$ git svn fetch

After all you may set core.bare=true. 毕竟你可以设置core.bare = true。 The resulting bare repository will be in repo/.git 生成的裸存储库将位于repo / .git中

git-svn is a Perl script, if you open it, you can realize that it doesn't contain word "bare" at all. git-svn是一个Perl脚本,如果你打开它,你可以意识到它根本不包含“裸”字。 Option "--bare" is not supported. 选项“--bare”不受支持。

As a workaround you can use simple "git svn clone" and then convert the resulting repository to bare. 作为一种解决方法,您可以使用简单的“git svn clone”,然后将生成的存储库转换为裸。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM