44

I've been using TortoiseSVN on Windows for years with local filesystem repositories for my own projects. I'm planning to start collaborating with a friend on one of the projects, and will be shifting the repository to my own website. I've read a lot of "git beats SVN!" posts over the last couple years, and figured I ought to at least see what the fuss was about. Some research turned up the "git svn" command, and that TortoiseGit claims to have some level of git-svn support. I like the idea of keeping the SVN repository, and doing some local commits or branches with git before committing them to the repository. The "shelve" command also sounds useful.

Unfortunately, while there's a number of CLI git-svn tutorials, there's nothing for TortoiseGit (which admittedly seems to be still in early development). As a result, I'm having problems trying to figure out what workflow I need to get these pieces to cooperate.

I have an SVN repository in D:\Projects\repositories\MyProject. I created D:\Projects\temp\gittest, and tried to do a TortoiseGit "Git Clone" of the repository. From there, I've had issues trying to indicate the location of the trunk/branches/tags folders (which are just the standard layout in my repository). I was only able to get useful results when I left those unchecked. When I did seem to get the git repository started correctly, I was able to make some changes and do a couple git commits, but then had problems doing an SVN DCommit.

So, I'm hoping someone out there can provide a reasonably detailed set of instructions on how to correctly use TortoiseGit with an existing SVN repository (with the repository on either the local filesystem or on a remote server). No "don't use SVN!" responses, please - I'm interested in learning how to get these two pieces to work together. If you feel TortoiseGit's SVN support isn't mature enough to make this work, that would also be useful information.

Thanks!

markerikson
  • 63,178
  • 10
  • 141
  • 157
  • Just to clarify, do you have an SVN *repository* in `D:\Projects\repositories` or an SVN *working copy* (ie. files you've checked out from your repository) – Edd Feb 16 '10 at 16:12
  • I create the actual repository folders under D:\Projects\Repositories, and then check out the contents elsewhere under D:\Projects. I was able to make a bit more progress using TortoiseGit against a SVN repository using svn+ssh, but then had issues trying to get commits made in the SVN checkout and the Git checkout to come together. I still haven't gotten TortoiseGit to play nice with a local SVN repository. – markerikson Feb 17 '10 at 01:18
  • Have you figured out TortoiseGit + git-svn setup? – Alex_P Mar 30 '10 at 16:28
  • Not really. I've been working on other projects. I did bookmark a few git tutorial sites, but learning more about it hasn't been a high priority. I'm a bit surprised that with all the git advocates out there, no one seems to have a TortoiseGit/svn tutorial put together. – markerikson Mar 30 '10 at 18:25
  • It's a wonder that there are still no good answers to this question. See my related question (almost a duplicate, but not quite): http://stackoverflow.com/questions/3676094/best-tooling-methodology-to-work-with-a-git-client-and-an-svn-repository – ripper234 Sep 09 '10 at 19:58

8 Answers8

27
  1. Create a directory
  2. right click, "Git Clone..."
  3. Enable"From SVN Repository" and select all further settings
StefanPapp
  • 301
  • 3
  • 3
9

Update: I stand by my answer to the question as written ("I'm planning to start collaborating with a friend..."), but if you do want/need to keep Subversion I rather liked my git-svn workflow.

The only reason git-svn exists is to allow the use of Git alongside an existing Subversion infrastructure. Since you essentially have no infrastructure, there is absolutely no reason not to just switch to Git completely. git-svn is better than svn, but should be avoided if at all possible.

I would strongly urge you to git svn clone -s --no-metadata <path_to_svn> then forget you ever had svn.

dahlbyk
  • 75,175
  • 8
  • 100
  • 122
  • 7
    Perhaps you didn't read my initial question carefully. I do indeed have an existing SVN setup, and am currently using it with a couple of friends on a project. I was hoping to experiment with using TortoiseGit to interact with the SVN server while my friends continued to use TortoiseSVN, since that's all they're familiar with. Thanks for taking the time to reply, but this really doesn't answer my actual question. – markerikson Jul 16 '10 at 18:12
  • I suppose I could have assumed your situation would changed in the last 5 months; I was responding based on the original wording: "I'm planning to start collaborating with a friend...". TortoiseGit has had git-svn support for a while now, have you had any luck with it? – dahlbyk Jul 16 '10 at 20:18
  • 3
    Sorry, you're right - that wording is out of date. I never did have much success getting TortoiseGit to interact well with SVN. Not sure whether it was TG's fault, or my lack of knowledge about Git. Since then, my focus has been on writing code rather than fiddling with TG. I'm still curious how to get them to cooperate properly, if anyone out there cares to put together a tutorial... – markerikson Jul 19 '10 at 03:40
  • I also tried to use TortoiseGit behind an svn server recently. But the implementation of git-svn is really slow in msysgit. I finally ended up using SmartGit instead, which is a much more powerful Git client, with a completely rewritten svn layer access. See http://www.syntevo.com/smartgit/index.html. – Yanflea May 09 '12 at 19:51
  • 3
    Also, an advice. IMO you should learn Git 'with Git' first (i.e. not svn) -and experiment on a fake project if necessary- before trying to use it via git-svn. Git is very different from SVN and deserves a dedicated learning. The apparent simplicity of a graphical tool could not make you avoid that. – Yanflea May 09 '12 at 20:03
9

This is probably obvious now, but tortoisegit now has built-in support for git-svn.

JBCP
  • 13,109
  • 9
  • 73
  • 111
4

It has been noted before - just putting it here as a proper answer :)

TortoiseGit now has baked-in support for SVN, so it should work fine.

getack
  • 172
  • 7
1

I used msysgit from http://msysgit.github.com/ so that I can pull from the subversion repository which requires accepting security certificate and other command prompt options. Once the code has been pulled I have been able to use TortoiseGit for most of the functionality (except for the svn push AFAIR)

Hara Hara
  • 11
  • 1
1

You can try to use TortoiseGit with no integrated SVN support rather as a usual Git client. To make this work you can install SubGit into SVN repository.

Below I've listed some basic instructions how to setup SubGit:

$ subgit configure SVN_REPOS
# Adjust SVN_REPOS/conf/subgit.conf to specify your branches and tags
# Adjust SVN_REPOS/conf/authors.txt to specify git & svn authors mapping
$ subgit install SVN_REPOS
...
$ INSTALLATION SUCCESSFUL

After installation you can find Git repository at SVN_REPOS/.git and work with it as with normal Git repository. Every git push performed by TortoiseGit triggers pre-receive and post-receive hooks that replicate incoming modifications into SVN repository.

For more details please refer to SubGit documentation and git-svn comparison page.

Starting from version 2.0 (not yet released at the moment of posting) SubGit allows to synchronize Subversion and Git repositories located on different hosts.

SubGit is a commercial tool, but it is free for repositories with up to 10 committers and for open-source and academic projects.

Disclaimer: I'm one of SubGit developers.

vadishev
  • 2,979
  • 20
  • 28
0

Just for the record: SourceTree for Windows is planing on supporting git-svn (and hgsubversion) from version 1.4 onwards. The corresponding issue is SRCTREEWIN-119.

cimnine
  • 3,987
  • 4
  • 33
  • 49
0

May be you can put your projects to github which supports an svn access. So you can continue to use TortoiseSVN and collaborate with others. On the other hand you can use things like sourceforge etc. to collaborate via SVN instead of git. BTW why not using git svn clone URLOfTheSVNRepos and later do git commits instead.

khmarbaise
  • 92,914
  • 28
  • 189
  • 235
  • Thanks for the thought, but I'm really looking for instructions on using TortoiseGit specifically. There are some instructions out there on using the git CLI with SVN, but nothing about TortoiseGit. – markerikson Apr 22 '10 at 13:38