How does Git deal with binary files?

I had essentially the same problem: I wanted to git pickle files, which are binary, but git thinks they're text.

I found this chapter on Git Attributes in the Pro Git Book. So I resolved my issues by creating a .gitattributes file with this line:

*.pickle binary

  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.