开发者

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.开发者_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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜