Rob Segal
Rob Segal

Reputation: 7625

What's a good way to diff a folder into a Subversion working copy

I have a working copy with an external company using a Subversion server. Locally I have a git repository with the same project since at my company we use git for everything. I want to bring the changes from my git repository over to the Subversion server on a regular basis an preferably in an automated fashion. I've tried using two different merge tools for this purpose kdiff3 (http://kdiff3.sourceforge.net/) and Kaleidoscope (http://www.kaleidoscopeapp.com/) however in both cases when copying files from the git folder to the Subversion working copy the .svn folder gets deleted which is not what I want as this puts the Subversion working copy in an "obstructed" state. I can also do an archive of the git repo and copy the archived folder into the Subversion working copy but when doing file deletions on the git repo do a paste into the Subversion working copy won't delete the missing files so it sort of gets me what I want. Any suggestions on perhaps an approach I haven't considered?

Upvotes: 0

Views: 44

Answers (2)

Deniz
Deniz

Reputation: 101

The first (command-line based) tool that comes to my mind for this kind of thing is rsync. What's nice about it is that it will propagate file deletions, ignore files that were not changed etc. It has a lot of command-line options that allow you to tweak its behaviour. Here's one possible example. But that's just a link I've found by quickly googling 'using rsync to merge changes into another folder'. You'll have to do some research and experimentation to see if rsync fits your needs : )

So the workflow could be, assuming the two repos are currently in sync:

  1. Make changes in git working dir (and do git commits/pushes as required by you)
  2. 'svn update' in the svn working dir
  3. Use rsync to merge changes from git working dir into svn working dir.
  4. Use svn tools to verify and commit the changes in the svn working dir.

Upvotes: 0

Lazy Badger
Lazy Badger

Reputation: 97282

Use single point of change (Git's working dir) and link Git-repo with Subversion, using git-svn (or SubGit)

Upvotes: 4

Related Questions