如何为svn存储库创建git远程分支
我在一个集中式 SVN 存储库之上使用 GIT。 SVN存储库仅包含主干,没有标签和分支。我之前所做的是使用 git svn 将远程存储库克隆到我的本地 git 工作区,我是唯一一个使用它的开发人员,所以一切都运行良好。
现在,越来越少的开发人员进来了,我们应该在这个 svn 存储库上工作,我想为 subversion 主干创建远程 git 分支,以便所有开发人员都可以在这些 git 分支上一起工作。我不想创建颠覆分支,因为它们太重了。但经过一番搜索后,似乎 git svn 不支持此功能,或者我错过了什么?
我也一直在考虑让我的 git 本地分支远程与其他开发人员共享,但不确定这是否有效。
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 create 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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我在这里找到了关于如何实现这一目标的精彩描述: 第 1 部分 part2
我采取了一些步骤来设置它,但随后它就成功了。您可以在 git 存储库之间自由交换提交,并将每个存储库与 SVN 存储库同步(双向)。
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).
问题在于 git 和 svn 保留历史记录的方式不同。 Subversion 假设所有开发人员协调都是通过中央存储库进行的,而 git 假设每个存储库将独立组装变更集。你和你的队友将能够通过 git 交换分支,但是当需要同步最终结果时,你会遇到问题。这就是为什么 git-svn 没有明确支持此功能。
我从你的评论中注意到,你不希望你的开发人员直接与 SVN 进行协作......我相信你有这样做的理由,但意识到这与 git-svn 的设计背道而驰。 git-svn 最好被视为 Subversion 客户端,而不是 git 存储库网络和中央 SVN 存储库之间的桥梁。您可能需要考虑允许您的团队在 Subversion 中创建共享工作分支。
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.