Sunny
Sunny

Reputation: 1983

Synchronizing Git and Svn

I have a SVN repository and I used:

git svn clone <svn url>

I have also created a repository on github. So every time I push the changes to github I would also commit the changes back to SVN.

git svn dcommit

Everything worked fine until my harddisk crashed. Now I need to restore a working copy of my source code. I can think of two ways of doing it:

  1. Clone the repository from SVN and add github as the remote. How do I add information about the github repository?

  2. Clone from github and then add the information about SVN manually? How do I add information about the SVN repo?

NOTE: I know the title of the question doesn't make sense. But I really don't know what to name it.

Upvotes: 4

Views: 264

Answers (1)

VonC
VonC

Reputation: 1329512

I would go with option 1.

You could:

  • re-clone your svn repo into a Git one, generating informations about the SVN repo in your local Git repo

    git svn clone svn://my/svn/repo -T trunk -b branches -t tags
  • add github information by:

    git remote add github [email protected]:git_username/projectname.git

Upvotes: 4

Related Questions