Working locally with Git when main repository is SVN

前端 未结 4 2036
南旧
南旧 2021-02-02 01:41

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 u

4条回答
  •  半阙折子戏
    2021-02-02 02:07

    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!

提交回复
热议问题