Does Git need more space than SVN?

Possible duplicate:
How much space do I need for Git vs SVN?

As I know, an important difference between Git and SVN is that: "SVN is a delta storage system - it stores the differences between one commit and the next, and Git does not - it stores a snapshot of which all files in your project look in a tree structure every time you commit. "

So, does this mean that Git needs more space than SVN, because it stores all snapshots instead of delta?

+4
source share
3 answers

I think you have it in the opposite direction, at least how much it trembles on the disk.

With SVN, each branch you check is a full copy plus delta. Thus, two branches mean two complete sets of PLUS files with all the information about SVN diff.

Git, on the other hand, stores one copy of files and all snapshots containing diff information. Therefore, for multiple branches, Git will always be less.

+6
source

From Pro Git chapter "Packfiles"

The original format in which Git saves objects to disk is called the free format of the object. However, sometimes Git accumulates several of these objects into a single binary file called packfile in order to save space and be more efficient. Git does this if you have too much when you run the Git gc command manually, or if you click on a remote server.

As you can see, Git does not always save each version of the file separately and makes use of the differences. In addition, Git compresses each file with zlib, which is very effective, at least for open source files.

However, it is not easy to say that Git uses more or less space than SVN. One of the reasons for this is that SVN only stores the latest revision locally, and with Git, you have a full copy of the repository on your computer. Thus, you cannot compare the space used by a single revision in SVN with the space used by a full repository in Git.

And comparing the space used by the SVN repository on the server with the Git spatial repository depends at least on the specific history of the changes and the types of files that you store in them.

+4
source

In fact, .git directories are smaller than .svn because git compresses data well and does not save some useless snapshots in it due to its design. And he uses delta too!

0
source

Source: https://habr.com/ru/post/1388323/


All Articles