4

I have several projects I want to control using Git. Each project consists of source code created in Visual Studio, PAD file (XML file), multiple .txt files, several .psd files (photoshop files), .jpg/.png/.bmp files, compiled setup file, etc. Which files should I store in Git repository and which not?

I know all text files like PAD file or .txt files are OK to store in there, but what about the .psd files, image files and compiled setup? Is there an article clearly describing why it is not a good idea to put binary data in Git?

One great advantage of putting everything inside Git is that when I tag a specific software version (which was released to public), once I checkout that tag, I get everything associated with that particular release - its setup file, all source code, images and promotional material, and I'm completely back in time without having to finding additional files somewhere else. What are the downsides? How have you solved this in your company?

Paya
  • 5,124
  • 4
  • 45
  • 71
  • 3
    http://stackoverflow.com/questions/1911005/git-and-binary-data http://stackoverflow.com/questions/540535/managing-large-binary-files-with-git – Josh Lee Jun 30 '11 at 16:35
  • 1
    There are no clear-cut rules, but generally large binary files and the result of compilation/generation steps should not be in the repo. The latter rule may be violated if you distribute source code and use code generators that are not generally available. – Fred Foo Jun 30 '11 at 16:38

1 Answers1

3

I put binaries in git too. Why not? Usually my PSDs aren't changing throughout the development stage as designs have already been fleshed out for example, but if they were then I would probably check them in...

citizen conn
  • 15,300
  • 3
  • 58
  • 80
  • To clarify, you mean binaries as in binary files and not binaries as in compiled objects/executables, correct? – Mark Peters Jun 30 '11 at 16:39
  • 2
    "Why not" -- because your repos grow very large and transporting them becomes very heavy. I once spent days checking out only the trunk of an SVN repo containing loads of sound files and images over a slow link to a foreign server. – Fred Foo Jun 30 '11 at 16:41
  • Perhaps consider submodules if you really want to store binaries? – Michael Mior Jun 30 '11 at 16:49
  • 2
    "Generated" files (binaries other otherwise) don't really belong in the version control database. Otherwise, it's okay. Your PSDs are not generated so I think it's fine to check them in. If you don't modify them that often, `git` will not have any problems with size. – Noufal Ibrahim Jun 30 '11 at 17:44
  • 2
    Yes, I think the word "binaries" requires clarification but I was strictly referring to binaries in the context of his question which I understood to be PSDs. Its true though that its on a case by case basis. Version control is version control though, you should version control your PSDs as well, whether you keep them in a submodule then that's probably a better practice but outside the scope of the question... – citizen conn Jun 30 '11 at 20:29
  • Sorry Folks,But I didn't get my answer,the answer need more clarifications – Hbirjand Nov 06 '14 at 04:55