Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add a new subversion remote into existing Git repository

Tags:

git

svn

I have a git repository fully tracking a remote SVN repo. Now I need to add a new branch that will be tracking a directory in a completely different SVN repo.

Is that possible?

like image 863
Šimon Tóth Avatar asked Dec 06 '10 15:12

Šimon Tóth


People also ask

Can I use git and SVN at the same time?

No interaction between them. Just ignore the . git folder for SVN and the . svn folder for Git and you should be fine.

How do I clone a SVN code?

# 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 we create remote repository in SVN?

SVN does not have the concept of local repository/remote repository, accordingly commit is directly reflected in the remote.


1 Answers

It is. git svn init only edits the default svn remote, you'll have to edit the config file.

Look in .git/config, copy and alter the existing svn-remote section, and run git svn fetch. For example:

[svn-remote "svn2"]
        url = http://bzzz.googlecode.com/svn
        fetch = trunk:refs/remotes/svn2/trunk
        branches = branches/*:refs/remotes/svn2/*
        tags = tags/*:refs/remotes/svn2/tags/*
like image 130
Tobu Avatar answered Nov 15 '22 20:11

Tobu