与多个开发人员一起使用 git 和 svn

发布于 2024-09-08 05:40:27 字数 254 浏览 6 评论 0原文

我有一个 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

狂之美人 2024-09-15 05:40:27

我也在看这个,我推荐的方法是

  • 使用 master 与 svn 存储库同步,并使用特殊分支名称来跟踪其他 svn 分支,例如 svn 中的 walko 分支,然后在 git 中,它是 walko-svn
  • 使用其他名称来同步git 存储库。

替代文本
(来源:wordpress.com

然后,工作方式是

  • 所有设计者通过 git-svn clone ... 从 svn 存储库同步,使用 masterbranch-svn name
  • all设计师也有同步到git仓库,但是保留上面的svn分支名称,
  • 所有设计师大多使用git仓库来协作开发,比如主题分支,
  • 当主题分支看起来不错时,每个设计师都可以rebase回master分支,这个设计师应该dcommit到svn仓库在它之后(获取git-svn-id),它们也被推回到git-repository。 (如果设置 svn 触发器,此工作可以自动完成)
  • 然后 git 存储库始终与 master 分支上的 svn 存储库同步 摘要

使用

  • git 存储库在非 svn 分支(如 master)上进行协作
  • 从非 svn 分支变基回 svn 存储库
  • 始终 保持 git repo (master) 与 svn repo 同步

请参阅我的博客,其中包含图片 http://larrycaiyu.com/blog/2010/07/10/svn-git-integration-1/

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.

alt text
(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/

彡翼 2024-09-15 05:40:27

我们遇到了同样的问题,但没有找到解决方法,所以我们切换到完整的 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.

暖伴 2024-09-15 05:40:27

我们的团队遇到了完全相同的问题,经过一些实验,我们设法提出了一个双向 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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文