与多个开发人员一起使用 git 和 svn
我有一个 svn 存储库(如果重要的话,没有 TLB 结构),我想将其与 git 一起使用。我可以进行 git-svn 克隆,处理 git 存储库中的更改,并在完成后提交回 svn 存储库。到目前为止一切都很清楚。
我不确定如何将此工作流程模型扩展到多个开发人员。我需要我的开发团队能够处理单个 git 存储库(从 svn 存储库克隆的存储库),它对于我们所有人来说应该像正常的 git 存储库一样工作。在某些时候,任何开发人员都必须能够提交回 svn 存储库。这可能吗?谢谢。
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 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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我也在看这个,我推荐的方法是
(来源:wordpress.com)
然后,工作方式是
使用
请参阅我的博客,其中包含图片 http://larrycaiyu.com/blog/2010/07/10/svn-git-integration-1/
I am looking at this as well, my recommend way is
(source: wordpress.com)
Then the way of workings are
Summary
see my blog with pictures http://larrycaiyu.com/blog/2010/07/10/svn-git-integration-1/
我们遇到了同样的问题,但没有找到解决方法,所以我们切换到完整的 git。
如果只有一个存储库与 svn 通信,那么事情就可以正常工作,但否则很快就会变得混乱。发生的事情是 git-svn 分支有自己的生命
你可以尝试这个
- 从 svn 创建存储库 git1 和 git2。
- 在 git 1 中进行更改并提交到 svn
- 将其拉入 git2,执行 git svn rebase 并查看发生了什么...
当您尝试将其拉入 git2 时,您必须创建一个从 svn 分支开始的新分支,但它不会跟踪它。
所以 git2 基本上有 2 个分支:svn 一个和 git1。因此,在能够将 git2 中的任何内容推送到 svn 之前,您必须先将 git1 分支合并到 svn 分支(即使它们是相同的)。
(我可能是错的,因为我不久前已经这样做了,也许有一个解决方案)
无论如何,我不得不这样做几次,因为当我们从“git-svn”切换到“git”时,我们创建了中央在每个人完成将自己的东西提交到 svn 之前,先使用 git-repository 。然后我必须从 svn 中挑选新的东西并将它们放回新的 git 存储库中,这真是一团糟。
因此,要么只使用 git,要么只有一个存储库连接到 svn。
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.
我们的团队遇到了完全相同的问题,经过一些实验,我们设法提出了一个双向 git-Subversion 桥,可以同步我们团队 git 存储库和公司 Subversion 存储库之间的更改。请参阅我的答案 https://stackoverflow.com/a/12155474/258772 或查看 https://github.com/mrts/git-svn-bridge
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