Question

At my workplace we have been using SVN (rather uneffectively) for quite some time and are finally looking at ways that we can incorporate Git into our everyday workflows. As I am one of the few employees here who has some past experience with Git (managing personal projects on GitHub), I'm playing around with git svn to use it as a client to our svn repository for the time being and hopefully writing up some documentation to help other developers get introduced to Git without requiring us to move our entire source control and build system over.

I've cloned our main SVN development branch using the following command in git bash:

git svn clone -r HEAD path_to_svn Work

And it has successfully created my work folder and pulled down all my files. I've been going through some of the sample workflows on this website for git svn tutorials which all look very promising. However, I'm wondering if its possible for my newly created Work directory to reference the SVN repo as well as Git. We use TortoiseSVN as our client to SVN and what I'm particularly looking for is the ability to right click on a cloned SVN repo in Windows and access tools such as "Check for modifications" to see what differences exist between the current code base and whats contained in the remote SVN repository.

Ideally, I'd like to be able to continue using our TortoiseSVN tools and commit dialogs when it comes time to actually pushing changes to the server while leveraging everything that's awesome about branching in Git and making more productive workflows. I feel that there will be a decent transition period where people onboard with these new technologies so I want to make this experience as friendly as possible. Is any of this possible? Or by switching to git-svn am I forced to use git as my exclusive client to the SVN server and using commands such as git svn dcommit to actually push my work.

Was it helpful?

Solution

When you git svn clone SVN-repository, you get local Git-repository with source SVN as remote (and can pull|push Subversion with Git-client). Thus - you can use SVN-client on Work: it does have nothing SVN-related

You can try to combine both Working Directories in single directory, but - with headache (NOT TESTED - checkout the same revision into another location with SVN, move .svn folder into Work, ignore .git folder in Subversion and .svn folder in Git) without guaranteed good results

OTHER TIPS

Since you are comfortable with TortoiseSVN, I would recommend you to use TortoiseGit. The UI & the experience are very much identical. See here for some screenshots of TortoiseGit. Creating the git repo in the same place as the svn is not a good idea. Because if you use TortoiseSVN to commit your changes to svn, the git repo is not in the same state. So the next time you git svn rebase your working directory will be in conflict with the changes git is trying to pull. Instead I would suggest you have your svn repository separate from your git clone. So if for some reason you are not clear on what you are doing on git, you can always switch back to svn. But don't rely too much on the back up (i.e svn) if you really want to use git-svn.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top