Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git SVN with binary files

When using git-svn and dcommiting binary files (images and JAR files) there is one difference: Images are treated as binary in SVN too if they are initally committed via SVN. Neither JAR files nor new images added to git then dcommitted to SVN does have any Svn Property like svn:mime-type.

This causes, repository viewer like Fisheye will handle these files as text-files and will create non-sense changeset diffs for them.. I expect there will be other problems on merging too.

Is there a simple but user friendly way to automatically set the correct mime-type for correct binary file handling?

I know, i know, there will be users who will say: WHY DO YOU TRACK JAR files in SVN? USe Nexus and Maven....YES, You're right, but JAR files are just one of the examples. The main problems relates to images!

like image 675
childno͡.de Avatar asked Jul 20 '11 09:07

childno͡.de


People also ask

How does SVN store binary files?

If Subversion determines that the file is binary, the file receives an svn:mime-type property set to application/octet-stream. You can always override this by using the auto-props feature or by setting the property manually with svn propset . Subversion treats the following files as text: Files with no svn:mime-type.

Does Git work with binary files?

Git LFS is a Git extension used to manage large files and binary files in a separate Git repository. Most projects today have both code and binary assets. And storing large binary files in Git repositories can be a bottleneck for Git users.

Can you use Git and SVN together?

git-svn is a specialized tool for Git users to interact with Git repositories. It works by providing a Git frontend to an SVN backend. With git-svn, you use Git commands on the local repository, so it's just like using normal Git. However, behind the scenes, the relevant SVN commands are sent to the server.

Can we use Tortoisesvn for Git?

You can checkout a git repository but you can't do most of other operations. You can setup tortoise git which provides same interface for Git although the commands are different.


1 Answers

Looks like you can set an [auto-props] in your subversion config that git will pick up on. Go to http://trac.webkit.org/wiki/UsingGitWithWebKit and look at the section titled Misc. Tips and Tricks

Looks like you can add something like:

[miscellany]
enable-auto-props = yes

# Add an additonal line for each type of binary file you wish to commit.
[auto-props]
*.jpg = svn:mime-type=image/jpeg

to your ~/.subversion/config

like image 115
Andy Avatar answered Sep 18 '22 14:09

Andy