News for hackers. Stuff that matters.
Re:Facebook's git repo is 54GB by maaaats on Friday April 25, 2014 @03:28PM (#7648562)
The big .git directory is probably binary revisions? Is there any good way around that in git?
Re:Facebook's git repo is 54GB by heavenlyhash on Friday April 25, 2014 @05:38PM (#7649177)
When I can't avoid referring to binary blobs in git, I put them in a separate repo and link them with submodules. It keeps the main repo trim and the whole thing fast while still giving me end-to-end integrity guarantees.

I wrote https://github.com/polydawn/mdm/ to help with this. It goes a step further and puts each binary version in a separate root of history, which means you can pull down only what you need.

Re:Facebook's git repo is 54GB by namdnay on Friday April 25, 2014 @06:23PM (#7649416)
you're not going to merge binary files, so git isn't the right tool. the standard way is to use maven. git handles your sources, and anything binary (libs, resources etc) goes on the nexus (where it is versioned centrally) and is referenced in your poms: simple and powerful
Re:Facebook's git repo is 54GB by heavenlyhash on Saturday April 26, 2014 @11:29AM (#7651694)
git is "the stupid content tracker", not "the stupid merge tool". Even for things you have no intention of branching or merging, it still gives you control over versioning... and there's a huge gap between the level of control a hash tree gives you versus trusting some remote server to consistently give you the same file when you give it the same request.
Re:Facebook's git repo is 54GB by spoiler on Friday April 25, 2014 @05:13PM (#7649072)
I'm a bit confused. Whenever I've used git on my projects, I'd make sure the binaries were excluded, using .gitignore

Don't other people do that, too? What's the benefit of having binaries stored? I've never needed that; I've never worked on any huge projects, so I might be missing something crucial.

Re:Facebook's git repo is 54GB by smsm42 on Friday April 25, 2014 @07:29PM (#7649743)
If there is a small number of rarely changing binaries (like icons, tool configs, etc.) then it may not be worth it to move them. Also if space is much cheaper than tool complexity and build time.
Re:Facebook's git repo is 54GB by maaaats on Friday April 25, 2014 @05:32PM (#7649158)
Well, it depends. Images are for instance binaries where a text diff makes little sense, so you have a copy of each version of the image ever used. And many projects use programs where the files are binaries. For instance, I've been on a project where Flash were used and the files checked in. Or PhotoShop PSD files, .ai files etc.
Re:Facebook's git repo is 54GB by spoiler on Friday April 25, 2014 @08:23PM (#7649898)
I usually keep a separate repo for PSD/AI files (completely neglected to consider them as binary files).

As for images, icons, fonts and similar, I just have a build script that copies/generates them, if it's needed.

I guess I've always been a little bit "obsessed" about the tidiness of my repositories.

Re:Facebook's git repo is 54GB by zhemao on Friday April 25, 2014 @06:34PM (#7649480)
If you don't have the source that produced those binaries your only choice is to have them downloadable from somewhere else (which is a real hassle for the developer) or just check them into the repo.
Re:Facebook's git repo is 54GB by Tobu on Friday April 25, 2014 @04:14PM (#7648792)
Stripping the binaries with filter-branch, or normalising them using smudge filters (for example, making sure zip-based formats use no compression).
Re:Facebook's git repo is 54GB by rickyc091 on Friday April 25, 2014 @03:43PM (#7648635)
Re-cloning a fresh repo should keep it small. There's also a git gc method which cleans up the repo. I guess another way would be to just archive all the history up to a certain point somewhere.
Re:Facebook's git repo is 54GB by masklinn on Friday April 25, 2014 @03:53PM (#7648685)
> Re-cloning a fresh repo should keep it small. There's also a git gc method which cleans up the repo.

There's only so much git gc can do. We've got a 500MB repo (.git, excluding working copy) at work, for 100k revisions. That's with a fresh clone and having tried most combinations of gc and repack we could think of. Considering the size of facebook, I can only expect that their repo is deeper (longer history in revisions count), broader (more files), more complex and probably full of binary stuff.

Re:Facebook's git repo is 54GB by Dylan16807 on Friday April 25, 2014 @05:32PM (#7649156)
Is that all actually code? Each commit would have to add an average of 5KB compressed so maybe 20KB of brand new code.
Re:Facebook's git repo is 54GB by masklinn on Saturday April 26, 2014 @08:29AM (#7651164)
> Is that all actually code?

Of course not, it's an actual project. There is code, there are data files (text and binary) and there are assets.

Re:Facebook's git repo is 54GB by namdnay on Friday April 25, 2014 @06:24PM (#7649423)
maven!
Re:Facebook's git repo is 54GB by syntheticlife on Friday April 25, 2014 @07:16PM (#7649682)
FWIW: Every time you modify a file in git, it adds a completely new copy of the file. 100mb text file, 100mb binary file - makes no difference. Modify one line, it's a new 100mb entry in your git repo.
Re:Facebook's git repo is 54GB by JelteF on Friday April 25, 2014 @07:58PM (#7649838)
No, git has delta compression. It only saves the changes.
Re:Facebook's git repo is 54GB by syntheticlife on Friday April 25, 2014 @08:05PM (#7649852)
Only when git repack operations run.
Re:Facebook's git repo is 54GB by Skinney on Saturday April 26, 2014 @06:59AM (#7650997)
which you can run at any time. Git also runs a minor gc every time you do a git push, which does do some compression.