简体   繁体   中英

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?

I have read man git-svn, and cannot find a method to clone a bare repo.

Edit 1

My tags on 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?

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. The resulting bare repository will be in repo/.git

git-svn is a Perl script, if you open it, you can realize that it doesn't contain word "bare" at all. Option "--bare" is not supported.

As a workaround you can use simple "git svn clone" and then convert the resulting repository to bare.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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