开发者

Synchronizing Git and Svn

开发者 https://www.devze.com 2022-12-21 08:04 出处:网络
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.

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.开发者_StackOverflow中文版 But I really don't know what to name it.


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 git@github.com:git_username/projectname.git
0

精彩评论

暂无评论...
验证码 换一张
取 消