Monday, December 16, 2013

Working on an SVN branch with git svn


Usually, I use git for most of my projects. However, one of my projects is hosted on SVN.

I really don't have anything against svn but I found it to be very slow and limited in functionality. So, I decided to look out for some way to continue using git on this project as well.

Luckily, I found git svn

git svn allows the developers to continue using git on their machines even if the actual remote repository is hosted on SVN.


Use Case: 

I need to work on a SVN branch named 'my_project_v1.23' which has svn url as 
"http://svn.mycompany.com/repos/my_project/branches/my_project_v1.23"


git config --add svn-remote.my_project_v1.23.url http://svn.mycompany.com/repos/my_project/branches/my_project_v1.23
git config --add svn-remote.my_project_v1.23.fetch :refs/remotes/my_project_v1.23
git svn fetch my_project_v1.23 
git checkout -b local_my_project_v1.23 -t my_project_v1.23
git svn rebase my_project_v1.23

Hope this helps


No comments:

Post a Comment