views:

81

answers:

2

I've scoured the web and found a lot about working with git-svn and branches, but nothing that fits my situation.

I'm working on a large project, and I work on several of many branches throughout the week. Standard ways of handling git branching wouldn't work for me here... just because of the size of the code involved. It takes about an hour to compile from the ground up, so I can't be switching back and forth between branches in that way. I want to use git-svn so I can use local branches. The svn branches might as well be considered separate projects, with common code in certain places.

All I want to be able to do is merge changes from one svn repo to another using git-svn, but I haven't found a way to do it from google or the git-svn docs. I handle this in svn by maintaining a separate svn checkout it its own directory for each branch, and just use the merge command to pull changes. I expected to be able to do something similar using git-svn, but I haven't found the way to pull changes from another svn branch. Is there a way to do this?

+3  A: 

You could use an approach similar to Mercurial: one branch per repository.

Each SVN branch would live in a git Repository through a git-svn (tailored to import/export only one branch).
Between the Git repositories, you could then track the branch of another git repo (aka, another SVNbranch), fetch it into a given git repo (another SVNbranch) and merge it to your current master branch, before git-svn dcommit that branch back to the relevant svn branch.

VonC
This is the best advice I've seen, but I can't quite get it to work without enormous hassle. I might be missing something, I'm new to git. For now I'm just going to use svn diff xxxxxxx -c xxx | patch until I understand it better.
Dave Clark
A: 

You could have a local shared clone of your git-svn repo. But then, you would have to update both separately. A better approach would be to use git-new-workdir, which will create a new working dir for you, with a separate index, but shared repo. So, if you update/fetch new commits in the original repo, then they'll become visible in the other working dir also. So, you can use separate working dirs, for each of your branches.

Ankit