tags:

views:

393

answers:

2

I know you can track a svn repo with git by using git svn init, however that is for if you want to create a brand new repo.

My situation is that I currently already have an existing git repo and want to track the trunk of a svn repo by making it a remote branch in my current git repo.

Any suggestions?

UPDATE:

After searching last night, I have finally found the answer:

http://i-nz.net/2009/01/15/selective-import-of-svn-branches-into-a-gitgit-svn-repository/

It seems that you have to actually go in and manually edit the .git/config file in order to add an svn branch to an existing git repo. So according to these instructions I would have to add an entry for each branch.

+2  A: 

This is actually what git svn init does -- the other git svn commands simply merge things together, etc. You can git svn init and/or copy the layout of an SVN repo cloned with git svn clone, and you should just be able to pull into a local branch, or fetch, and so on. Have some time with the man page for git svn and you shouldn't have too much trouble piecing something together; if you do, #git on freenode is a good resource. So, this should be possible without too much trouble, but I don't know exactly how to do it all.

cookiecaper
+1 for #git. It's been a great resource for me in the past.
Abizern
+1  A: 

After searching last night, I have finally found the answer:

http://i-nz.net/2009/01/15/selective-import-of-svn-branches-into-a-gitgit-svn-repository/

It seems that you have to actually go in and manually edit the .git/config file in order to add an svn branch to an existing git repo. So according to these instructions I would have to add an entry for each branch.

rip747