Question

We have 2-3 small teams of 2-3 people. We all use git for local and svn for central repository and git-svn got sync. This is works all the time except when we want to share our code between the team it self.

So we have tried out git pull, this creates lots of conflicts and it does not detect that we are on the same tree. It fetches all the changes (same as clone then pull) Of course i dont want to clone full repo. every time I want to share.

Please suggest a better flow.

  1. We can't get rid of central svn.
  2. We can't clone every time.
Was it helpful?

Solution

Nominate one team member as the 'git hub', he/she syncs with the SVN server, other team members interact with them, rather than the SVN server directly. That way git will know that all team members are on the same tree.

OTHER TIPS

SubGit seems like a great alternative for you.

SubGit is server-side solution, it enables Git access to Subversion repository and vice versa. That means you can work with Git repository only, using Git client of your choice.

You need to install SubGit into your Subversion repository once. After that SubGit immediately translates svn revision into git commit on every svn commit and git commit into svn revision on every git push.

SubGit is closed-source software but it is free for open-source projects. For more information please refer to SubGit documenation.

To add to Chris Huang-Leaver's answer, you need a central point to dcommit/rebase with the svn repo.
That doesn't deny the "decentralized" aspect of Git, it simply allows everyone to work with, as one of their remote repositories, one "central" repo of reference (i.e. the one sync with svn)

There is no easy way to avoid the burden to clone everything coming from the (potentially huge) svn repo, because the resulting Git repo cannot be split into submodules.
That leaves at least one "solution", which would involve:

  • creating different Git beside the main one (which sync with SVN)
  • exporting patches from the main repo
  • applying those patches to each Git repo representing a project within the main Git repo.

It obviously needs to be automated, but one team would focus on one of those git repos as its "central" repo, and the person in charge of SVN synchronization would update those smaller Git repos with patches coming from the main (and hidden) Git<=>SVN repo.

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