-1

I'm using git as a revision control system for all my projects.

I understand that there are very good reasons not to put all non-sourcecode files in there. But then where do I put them?

They are intimately linked to the sourcecode (if a GUI-script changes, usually at least some images change with it).

durron597
  • 31,968
  • 17
  • 99
  • 158
col000r
  • 609
  • 1
  • 7
  • 14
  • 2
    No, those should go in Git. If you want to version control the images, they belong in the repository. You shouldn't care about putting *images* in your Git repo. Those aren't typically "large" files, in the grand scheme of thing. – user229044 Oct 07 '14 at 14:07
  • If I put them in .gitignore they won't be in the repository and I won't be able to restore my project to a previous state (or at least not as easily). What's the use of keeping all the history of the sourcecode if the old stuff won't work with the newest 3D files and images? Is there a good way to keep an entire big project with all its files in revision control so I can jump back to any commit and have everything right there, not just the source-code? – col000r Oct 07 '14 at 14:12
  • possible duplicate of [Managing large binary files with git](http://stackoverflow.com/questions/540535/managing-large-binary-files-with-git) – Keith Thompson Oct 07 '14 at 18:09

1 Answers1

4

Put them into git!

If they are required to make the source code work, I would include them.

You need really good reasons not to include them. In your question, you don't mention any reason. Binary files might not be handled well by git, but that doesn't mean they are not handled at all. As long as the image doesn't change on very many commits, the benefits of including it outweigh.

Unapiedra
  • 15,037
  • 12
  • 64
  • 93
  • thanks. that's what I wanted to hear :) the other files are important too! – col000r Oct 07 '14 at 14:14
  • 1
    @col000r: Good advice in *most* cases. But what if you have really large binaries that change frequently and that you need to track? You could reach the point where cloning the git repo becomes difficult because it's so huge. In that case, storing the binaries in a non-distributed system like CVS or SVN might actually work better (with information stored in git indicating which version of each binary file you want). I expect somebody has already implemented something like this, though I don't know the details. – Keith Thompson Oct 07 '14 at 14:26
  • 1
    @KeithThompson git-annex recommended [here](http://stackoverflow.com/a/6635160/461597) and the apparently older [git bup](http://stackoverflow.com/a/5384276/461597) and `git-fat`. – Unapiedra Oct 07 '14 at 14:31