JC Web Concepts

Custom Web Developments

Using Git for SVN

| Comments

So I have switched from SVN to Git and I am very happy about it. When I am at work I am stuck using SVN and I hate it. So I learned about a command that git has called git svn. It allows me to clone an SVN repo and locally use Git for it. I can make my commits and keep things versioned via Git. When I am done I can then commit it to the SVN repo and nobody would know I used Git instead of SVN. What is nice is it will commit all the changes, not just one massive one. I have yet to run into and issue but that’s ok if I do. So if you are a Git user stuck in an SVN world, then this is the way to save yourself. Let me show you an example of how to use this.

1
git svn clone "urlToSVNrepository" "LocalLocationYouWantThis"

Example

1
git svn clone "http://svn.google.com/sampleTest" "sampleTest"

Now lets say your repository has a trunk, branches, and or tags, you can do something with them as well.

1
git svn clone "urlToSVNrepository" "LocalLocationYouWantThis" -T trunk -b branches -t tags

Example

1
git svn clone "http://svn.google.com/sampleTest" "sampleTest" -T trunk -b branches -t tags

So now you have your svn project using git, which is nice. What also is nice is your project no longer has a bunch of .svn folders like you see in SVN land. That should be one of many things that will make you want to do this. I will make tutorial video on this soon so stay tuned if you are interested.

Comments