tags:

views:

68

answers:

3

I am doing a video player. I have the following in my project folder:

these four dirs should each be on their own line: /source /sample_applications /images /videos

Right now the repo just includes the /source directory...which is code only.

It is on my local computer. I am thinking of adding it to git hub.

My question is: should I add the sample apps, the images and the videos to the repo? Is that something that people normally do and that other people want people to do? Can git even handle videos(noob here)?

+2  A: 

Here is a similar question on stack overflow:

http://stackoverflow.com/questions/540535/managing-large-binary-files-with-git

In short, yes it can handle binary files (read video), but if they are large it might be a hassle for people when they initially clone your repo. If they are small, and will be useful for programmers using your program in most situations, then it may be a good idea to add them to a repo. If they are large and necessary there is a discussion on that page about using a git-submodule to manage the video part of the repo.

Thomas Sidoti
I agree, storing large binary files (video) in a git repo seems like a bad idea to me, and it's good way to make people not want to clone your repo after a few revisions.
Jamie
What's considered a medium size repo(in MB)? Big?
Ryan
Obviously there are no hard numbers to say this is too big, but you'll want to think about whether or not you'd want to download a file that large. Keep in mind that if those binary files ever change, than the old versions of those files will stay in the repository. If the videos total to less than several tens of megabytes, and you don't intend to change then it should be fine. For comparison sakes, the linux kernel repository size is larger than 300MB, and the android repo is larger than 2GB. (Those are large repositories)
Thomas Sidoti
A: 
  1. Samples applications in source form, yes.
  2. Images, if they are resources for the applications, yes.
  3. Video, likely not. If its not required to build the application, don't include it.

And yes, git does fine with binary data.

Yann Ramin
+1  A: 

It depends on how big the binary files are. If they add up to ten or twenty MB than you should be OK. If there are hundreds of megabytes of video and images then it'll blow up the size of the repo quite dramatically.

Git compresses all the files and only stores diffs between revisions. This works really well for text, not so much with binaries. If there is a slight change in the files it's quite likely the diff algorithm is not going to make a perfect diff, but add a whole new version. This is even worse for video as it is already very aggressively compressed and thus will not take advantage of git compression. Expect the size of your repository to be that of a sum of all the video files' sizes.

Another thing about got is that whenever you clone, the whole copy of the repository hers transmitted. Again, this becomes an issue with a big repository.

If, however, the size is not an issue I would highly recommend to put these binary files into a separate repository and link it to the sourse repo using got submodules. This way your source repo stays nice and small, giving you the freedom to handle binaries in some other way in the future.

Igor Zevaka