Using git and svn with multiple developers
I have a svn repository (with no TLB structure if it matters) which I want to use along with git. I can do a git-svn clone, work on my changes in the git repo and commit back to the svn repo whenever I am done. It's clear until this point.
I'm not sure how to extend this workflow model to multiple developers. I need my dev team to be able to work开发者_C百科 on a single git repo (the one cloned from the svn repo) which should behave like a normal git repo for all of us. At some point, any developer must be able to commit back to the svn repo. Is this possible? Thanks.
I am looking at this as well, my recommend way is
- use master for sync with svn repository and special branch names to track other svn branches, like walko branch in svn, then in git, it is walko-svn
- use other names to sync with git repository.
(source: wordpress.com)
Then the way of workings are
- all designers sync from svn repository by git-svn clone ..., using master and branch-svn name
- all designers also has sync to git repository, but keep above branch name for svn
- all designers mostly use git repository to collaborate development, like topic branch
- when topic branch seems good, every designers can rebase back to master branch, this designer should dcommit to svn repository and after it (get git-svn-id), they are also pushed back to git-repository. (this job can be done automatically if set svn trigger)
- then git repository is always sync with svn repo on master branch
Summary
- use git repository to collaborate on non-svn branch (like master)
- rebase back to svn repository from non-svn branch
- always keep git repo (master) sync with svn repo
see my blog with pictures http://larrycaiyu.com/blog/2010/07/10/svn-git-integration-1/
We had the same problem and we didn't find a way to do it, so we switch to full git. Things work fine if only one repo communicate with svn, but otherwise that's getting messy really quicly. What happend is the git-svn branch has its own life
You could just try this
- create to repo git1 and git2 from svn.
- make a change in git 1 and dcommit to svn
- pull it int git2, do a git svn rebase and see what's going on ...
when you try to pull it in git2, you have to kind of create a new branch which start from the svn one , but it's not tracking it. So git2 has basically 2 branch the svn one and the git1. So before being able to push anything from git2 into svn you have to merge firs the git1 branch to the svn one (even if they are identical). (I might be wrong because I have done that a while ago and maybe there is a solution)
Anyway, I had to do it a couple of times because when we switched from 'git-svn' to 'git', we created the central git-repository before everybody finish to dcommit their own thing to svn. I had then to pick new stuff from svn to put them back in the new git repo and that was really a big mess.
So either use only git, or have only one repo connected to svn.
Our team had exactly the same problem and after a bit of experimentation we managed to come up with a two-way git-Subversion bridge that synchronizes changes between our team git repository and the corporate Subversion repository. See my answer at https://stackoverflow.com/a/12155474/258772 or take a look at https://github.com/mrts/git-svn-bridge
精彩评论