views:

79

answers:

3

I'm playing with git in order to check if I can use it for my next project. I need to ask how git deal with binary files.

  • Do I have to set something to tell git if some files are binary, just like svn? Or, git just can handle binary data automatically?
  • If I change the binary file, so that I have 100 binary revisions, git just stores all the 100 versions in the repository?
  • What's the submodules for with git?
+3  A: 
git add my-binary-file
git commit -a
git push

Will add your binary file : it is automatic.

Indeed, if you have 100 versions of your file it will store it (but compressed).

You can use submodules to make references to other repositories.

Guillaume Lebourgeois
no need for `-a` on `git commit`.
Philip Potter
+4  A: 
  1. Git can usually detect binary files automatically.
  2. No, Git will attempt to store delta-based changesets if it's less expensive to (not always the case).
  3. Submodules are used if you want to reference other Git repositories within your project.
Amber
+5  A: 

Git uses a heuristic to try to determine if a file is a binary. See this article for more information and how to force git to treat a given file as a binary.

For good tutorial on submodules see here and here

Jason Jenkins