2

For reasons I will not go into explaining (unless required) I have two repos, a subversion and a git one, where my project (identical copies of it) is located. I need to keep it this way, if possible.

Hence, what I would like to accomplish in order to maintain consistency between the two, is to set up a directory on my machine where I can svn checkout the project, work on it, and then push the changes to both the svn and the git repos.

I have read something about the git svn command but from what I gathered it only serves as a way to use git locally and then push (rather, dcommit) your work to the svn repo. Nonetheless, I naively tried issuing: git svn init <url to svn repo> -s --username <uid> test (did not prompt for pwd, did not checkout working copy, only created folder .git inside folder test) followed by: git svn clone <url to git repo> test and it returned:

svn-remote.svn.url already set: <url to svn repo>
wanted to set to: <url to git repo>

However, my hopes are high thanks to this post here on SO: How to deal with Git-svn when have to use both Git and Subversion where it looks like the OP's workflow consists of both git svn dcommit and git push commands. If there is a way to accomplish what I wish, could someone please instruct me step by step on how to do it?

Thanks in advance.

P.S. As an added bonus of this peculiar configuration, I would like to be able to svn:ignore a certain folder of my project but have it pushed on the git repo (i.e. the img/local folder must not be committed to svn since there is a rule saying it should be ignored, but there is no such entry in the .gitignore file, so I assume that files added to it will be pushed to the git repo, but not to the svn one, right?)

Community
  • 1
  • 1
Andrea Aloi
  • 971
  • 1
  • 17
  • 37
  • Update: I have just stumbled upon [this post](http://stackoverflow.com/questions/3162949/manage-source-under-git-and-svn-simultanously-does-it-make-sense) where it looks like what I want to accomplish is in fact possible, however it does not go into detail as to how I can boostrap this set up... – Andrea Aloi Oct 24 '13 at 07:49

1 Answers1

1

The post you reference would require as simple a bootstrap as:

  • moving your .git folder in the root directory of your svn local workspace
  • examine the output of a git status, and see if you need to add anything to your .gitignore.

The other option would be to use a dedicated tool, specialized in the round-trip synchronization of svn-git repos, like SubGit (presented on GitMinutes episode 22).
But then, the working spaces (one for git, one for svn) would still be separate.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250