当主存储库是SVN时,使用Git本地工作 [英] Working locally with Git when main repository is SVN

查看:110
本文介绍了当主存储库是SVN时,使用Git本地工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有一个我想结算和贡献的开源项目。主要的存储库是SVN,但我想在Git中工作。这是可能的吗?



我的大部分搜索都会引导您从SVN移动到Git(或以其他方式)并不回头看。


  • 如果我签出项目,进行更改并将其推送到我在Github上创建的分支,我应该如何通知原作者?

  • 将包含在Git仓库中的贡献纳入SVN仓库的难度有多大?

  • 只需比较两个版本(我的最新结账/ /更新和我自己的本地最新提交),从中生成补丁并发送给他们;这应该被认为是后备工作流程还是标准方法?


    假设原始作者没有兴趣学习除了SVN。



    [更新] 我没有也不希望拥有对SVN存储库的访问权限。我正在寻找解决方法。



    [Update2] 如果补丁确实是我唯一的选择,那么我应该注意哪些补充警告?

    幸运的是, git-svn 就是为了这个目的。它使您可以在本地使用git,同时还可以在希望的时候检入SVN。这很简单,如果你在这里或通过谷歌搜索 git-svn ,有很多信息。



    http://flavio.castelli.name/howto_use_git_with_svn 上的教程,您可能想先看看。



    编辑:要生成SVN兼容差异,您可以使用 git diff --no-prefix 。但请注意,此格式与TortoiseSVN不兼容。如果需要兼容性,则必须使用某种类型的shell脚本;请参阅此处的示例: http://mojodna.net/2009/ 02/24 / my-work-git-workflow.html



    编辑: git-svn的一个潜在缺点是它不处理svn外部。你必须自己处理。



    祝你好运!


    There is an open source project I want to checkout and contribute to. The main repository is SVN but I want to work in Git. Is this possible?

    Most of my searches turns up guides where you move from SVN to Git (or the other way around) and dont look back.

    • If I checkout the project, make a change and push it to the branch I created on Github, how should I notify the original authors?
    • How hard is it to include a contribution made on a Git repos into a SVN repos?
    • Just comparing two revisions (my latest checkout/pull/update and my own local latest commit), generate a patch from it and send it to them; should this be considered a fallback workflow or is the standard approach?

    Assume that the original authors have no interest whatsoever in learning anything other than SVN.

    [Update] I dont have, nor do I want to have, commit access to the SVN repository. Im looking for workarounds for that.

    [Update2] If patches are indeed my only option, are there any additional caveats I should be aware of?

    解决方案

    Luckily there's git-svn for exactly this purpose. It enables you to use git locally while also being able to check in to SVN when you wish to do so. It's fairly straightforward and there are lots of information if you search for git-svn here or via Google.

    There's a tutorial at http://flavio.castelli.name/howto_use_git_with_svn that you might want to look at first.

    Edit: To generate SVN compatible diffs you can use git diff --no-prefix. Note however that this format is not compatible with TortoiseSVN. If compatibility is needed you would have to use some sort of shell script; see example here: http://mojodna.net/2009/02/24/my-work-git-workflow.html

    Edit: One potential downside of git-svn is that it does not handle svn externals. You would have to handle those yourself.

    Good luck!

    这篇关于当主存储库是SVN时,使用Git本地工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆