开发者

How to create git remote branch for svn repository

I am using GIT on top of one centralized SVN repository. The SVN repository only contains trunk, no tags and branches. What I did before is using git svn to clone the remote repository to my local git workspace, I am the only developer works on it so everything works well.

Now, few more developers come in and we should work on this svn repository, what I want to cr开发者_开发百科eate remote git branches for the subversion trunk, so that all developers can work together on these git branches. I do not want to create subversion branches because they are too heavy. But after doing some search, it seems like git svn does not support this feature, or am I missed something?

I've been also thinking that make my git local branch remote to share with other developers, but not sure if this works either.


I found a great description on how to achieve that here: part 1 part2

I takes some steps to set this up, but then it works successfully. You can freely exchange commits between the git repositories, and also sync each one of them with the SVN repository (in both directions).


The problem lies in the differences between how git and svn retain their histories. Subversion assumes that all developer coordination occurs via the central repository, while git assumes that each repository will be assembling changesets independently. You and your teammates will be able to exchange branches over git, but when it comes time to sync the final result, you're going to run into problems. That's why git-svn doesn't explicitly support this feature.

I note from your comments that you don't want your developers working with SVN directly for collaboration... I'm sure you have your reasons for this, but realize that runs counter to git-svn's design. git-svn is best thought of as a Subversion client, rather than a bridge between a git repository network and a central SVN repository. You might want to consider allowing your team to create shared work branches in Subversion.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜