Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 915
hugemeow Avatar asked Sep 22 '12 13:09

hugemeow


People also ask

Can you clone a bare repository?

Inside the clone create a commit and push the commit to origin . The bare repository can be cloned several times and one can exercise pushing and pulling changes.

How do I clone a SVN repository?

# Clone a repo with standard SVN directory layout (like git clone): git svn clone http://svn.example.com/project --stdlayout --prefix svn/ # Or, if the repo uses a non-standard directory layout: git svn clone http://svn.example.com/project -T tr -b branch -t tag --prefix svn/ # View all branches and tags you have ...

Can I use git and SVN at the same time?

You can clone a subversion repository to your machine using git svn clone <SVN repo URL> . The code will be available as a git repository. You can do your work there and make local commits as you please. There is a command line option to get a "shallow" checkout rather than the entire repository which is often useful.

What does git SVN clone do?

The git svn clone command transforms the trunk, branches, and tags in your SVN repository into a new Git repository. Depending on the structure of your SVN repo, the command needs to be configured differently.


1 Answers

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

like image 145
Dmitry Pavlenko Avatar answered Nov 02 '22 23:11

Dmitry Pavlenko