techsjs2013
techsjs2013

Reputation: 2627

How to mirror my source code that is in SVN repository with git

How to mirror my source code that is in SVN repository with git.

My firm keeps all its source code in SVN. I what to checkout all the code from the svn repository and then import it into a git repo on the internet so I can go home and get everything out of the git repo. I am never going to be making code changes at home so this is going to be a one-way mirror.. I just want to keep mirroring the code I have at work in my git repo and then downloading it at home?

Upvotes: 1

Views: 94

Answers (2)

techsjs2013
techsjs2013

Reputation: 2627

I got it working by doing the following steps:

cd ~/tmp/svn-mirror/
git svn clone http://svn/java mirror.git

cd ~/tmp/svn-mirror/mirror.git/
git remote add origin [email protected]:MIRROR.git
git push origin master

Then Script
#!/bin/bash
cd ~/tmp/svn-mirror/mirror.git/
git svn rebase
git push origin master

Upvotes: 0

Ziaunys
Ziaunys

Reputation: 76

Have you explored using git-svn? It allows you to operate between a git and svn repository. Here's a link: http://www.kernel.org/pub/software/scm/git/docs/git-svn.html

Upvotes: 3

Related Questions