如何使用 git-svn 将主干的更改合并到 svn 中的分支?
我看到有人建议使用 git-svn 进行合并并将其提交回 svn。
我正在寻找一个好的分步指南。
- 值得这么麻烦还是我应该使用 svn 来做这件事。
- 人们会看到我使用了 git 并且有关于 svn 中合并的元数据吗?
- 我可以克隆我选择的主干和 1 个分支吗?
- 我是否需要完整克隆,或者可以从创建分支的位置导入它吗?
I've seen people suggest to use git-svn to do the merge and commit it back to svn.
I'm looking for a good step by step guide.
- Is it worth the trouble or should I just use svn to do it.
- Will people see I've used git and is there any meta data about the merge in svn?
- Can I do a clone of trunk and 1 branch I select?
- Do I need a full clone or can I import it from the point where the branch was made?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我已经使用了这篇文章中的说明并取得了很大的成功。 http://justaddwater.dk/2009/03/09/using-git -for-svn-repositories-workflow/
我使用 git 在分支之间进行合并,然后将它们提交到 svn 存储库。这不遵循 svn 的合并过程,因此这可能会给其他用户带来问题。 svn:merge 属性未设置
git-svn 不会在 svn 存储库中留下任何您正在使用 git-svn 的证据。
I have used the instruction in this post with much success. http://justaddwater.dk/2009/03/09/using-git-for-svn-repositories-workflow/
I use git to merge between branches then commit them to the svn repo. This does not follow the merge procedure for svn and so this can be problem for other users. the svn:merge property is not set
git-svn does not leave any evidence in the svn repo that you are using git-svn.
我认为这取决于你想在 SVN 中保留多少信息。如果你使用git进行合并,我相信SVN将不知道更改来自哪里,或者换句话说,它看起来像SVN主干和分支仍然是分开的。
不,它看起来就像是对主干的新提交。
如果您的意思是将 git-svn 克隆到新的 git 存储库中,那么是的。只需克隆 git-svn 并删除无关的分支,或者在克隆之前直接在 git-svn 存储库中执行此操作。
这是一篇如何的文章将 SVN 存储库转换为 git 存储库。我认为大部分内容都适用于这种情况。
Git 克隆通常是完整克隆,除非您使用
--depth
选项。如果您想丢弃以前的历史记录,您可以随时将所有提交压缩到较旧的历史记录中,或者只需删除.git
目录并初始化一个新的存储库。I think it depends on how you much information you want to retain in SVN. If you do the merge using git, I believe SVN will not know where the changes came from, or in other words, it will look like the SVN trunk and branch is still separate.
No, it would just look like a new commit onto trunk.
If you mean clone your git-svn into a new git repo, then yes. Just clone the git-svn and delete the extraneous branches, or do that directly in the git-svn repo before you clone.
Here is a post how to convert an SVN repo to a git one. I think most of it would apply in this situation.
Git clones will usually be full clones, unless you use the
--depth
option. If you want to throw away the previous history, you can always squash all the commits into an older one, or just delete the.git
directory and init a new repo.我读过一些人们建议这样做的文章,但我认为只有当您同时使用 GIT 和 SVN 来处理相同的代码时才应该使用它(使用 git 的本地存储库和使用 svn 的托管存储库)。我建议你坚持使用 VCS 并获取适当的合并工具,例如 BeyondCompare 或 Kaleidscope
有关 git-svn 的小教程可以在
http://flavio.castelli.name/howto_use_git_with_svn
I have read a few articles of people suggesting this, but I think it should only be used if you both work with GIT and SVN for the same code (local repo with git and hosted repo with svn). I would advise you to just stick to your VCS and get a proper merge tool like BeyondCompare or Kaleidoscope
A small tutorial about git-svn can be found at
http://flavio.castelli.name/howto_use_git_with_svn