Git and Svn Sync

I have an SVN repository and I used:

git svn clone <svn url> 

I also created a repository on github. Therefore, every time I push changes to github, I also pass the changes to SVN.

 git svn dcommit 

Everything worked fine until my hard drive crashed. Now I need to restore a working copy of the source code. I can think of two ways to do this:

  • Cloning a repository from SVN and adding github as a remote. How to add github repository information?

  • Clone from github and then add SVN information manually? How to add SVN repo information?

NOTE. I know that the title of the question does not make sense. But I really don't know what to call it.

+4
source share
1 answer

I would choose option 1.

You can:

  • re-clone your svn repository in Git, generating SVN repo information in the local Git repository

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

      git remote add github git@github.com : git_username / projectname.git 
+4
source

Source: https://habr.com/ru/post/1302023/


All Articles