5 ms·
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 on
by _ikke_ 14y ago
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.
- rkangel 14y agoErrr, 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.
- andrewaylett 14y agoServer-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).