Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Branching in SVN is not cheap. It basically has to copy the entire directory structure into a new subdirectory (branches directory).

In git, it just creates one file with a 40 byte hex.



Errr, no - while that's what you see in the directory tree, that's not how it's done internally. SVN has a data model where multiple paths in the repo tree can point to the same underlying file object, so a branch requires no file copies, just updating what the directory tree looks like. Even that is done in a very efficient way. It might not quite be 40 bytes, but it is negligibly small.

This technique is in fact extremely similar to how Git works.


Server-side, that's cheap -- it doesn't actually copy any data. Client-side, it's also cheap: you `svn switch` to the new branch, which is identical to your old branch, so only minimal housekeeping on disk (just like git).




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: