Search code examples
gitsvngithubgit-svn

Is there a way to have media in subversion and code in git?


There is a project which I have recently become part of. The project is listed in sourceforge.net and they have been using its services for last several years. The project has been using sourceforge.net for 17 years and it has lot of graphical assets, music etc. Now they want to migrate the project to github.com.

Now github.com isn't that great for providing free space even if its an open-source project. It conks out at 1 GB for free space and it isn't great with images, audio, video etc. (only exception is using git-lfs which has its own limitations). Git itself makes a copy of the repo. inside .git which doesn't help its case especially with big media files. So even a single 500 MB repo. will top 1 GB easily.

I have seen some repos. where the code part is kept at github.com or any git repository, while the images/animation etc. is kept at sourceforge or some place which has svn.

How to go about doing about doing that. I am guessing the way to do that is using git-svn but how should it be approached ?

I did read Is it possible to have a Subversion repository as a Git submodule? but that's so old so would hope in the interim period something new has come along


Solution

  • Git itself makes a copy of the repo. inside .git which doesn't help its case especially with big media files. So even a single 500 MB repo. will top 1 GB easily.

    As @Tom already told, git is not for binaries. Git was designed to track textual content. In contrast, SVN universally supports textual and binary data. For example,

    • Subversion repository does not care whether a file is human-readable or not — its diff engine is a binary delta algorithm, not a contextual diff engine. If you change one byte in a multi-gigabyte binary file, Subversion needs only to store that one byte (plus metadata) for the new version of your file.

    • Subversion supports sparse working copies (shallow WCs) so that you don't have to keep a clone the whole repository, just grab the subtree you are working with at the moment.

    • Subversion fully supports lock-modify-unlock versioning model. This means that you can select which files are nonmergeable and force or ask users to lock them before editing to avoid binary conflicts.

    I have seen some repos. where the code part is kept at github.com or any git repository, while the images/animation etc. is kept at sourceforge or some place which has svn.

    How to go about doing about doing that. I am guessing the way to do that is using git-svn but how should it be approached ?

    I guess that one of the projects you've seen is SuperTuxKart. The project's code is controlled by git in multiple repositories on GitHub and its media assets are controlled by Subversion on SourceForge.

    It seems that both systems are used independently without git-svn or similar tools. Programmers use git, artists use SVN. So if it is not important for you to have all the data in a single repository, you could try this approach. See the pages https://supertuxkart.net/Source_control and https://supertuxkart.net/Media_Repo.

    Said all this, I'd like to note again that it's unclear why you want to switch to git and what kind of problems you'd like to solve this way:

    The project has been using sourceforge.net for 17 years and it has lot of graphical assets, music etc. Now they want to migrate the project to github.com.

    As far as I understand, SVN has been used by the project for 17 years and now you want to migrate the code to Git. But have you considered other DVCSes?

    What kind of problems git solves for your project?