6

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 delta storage system - it stores the differences between one commit and the next, while Git doesn't do this - it stores a snapshot of what all the files in your project look like in the tree structure each time you commit".

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

Community
  • 1
  • 1
Dagang
  • 24,586
  • 26
  • 88
  • 133

3 Answers3

6

I think you have it backwards, at least as far as how it shakes out on disk.

With SVN, each branch you check out is a full copy plus deltas. So two branches means two complete filesets PLUS all the SVN diff info.

Git, on the other hand, keeps a single copy of the files plus all the snapshots containing the diff info. So for multiple branches, Git will always be smaller.

Evan Davis
  • 35,493
  • 6
  • 50
  • 57
5

From Pro Git chapter "Packfiles":

The initial format in which Git saves objects on disk is called a loose object format. However, occasionally Git packs up several of these objects into a single binary file called a packfile in order to save space and be more efficient. Git does this if you have too many loose objects around, if you run the git gc command manually, or if you push to a remote server.

As you can see Git doesn't always store each version of a file separately and uses differences as well. In addition, Git compress every file with zlib that's quite effective at least for plain text source code files.

Still it's not easy to tell for sure whether Git uses more or less space than SVN. One reason for that is that SVN stores locally only the last revision while with git you have full copy of the repository on your machine. So you can't compare space used by one revision in SVN with space used by full repository in Git.

And comparing space used by SVN repository on server with space Git repository depends a lot at least on specific revisions history and types of files you store in them.

KL-7
  • 46,000
  • 9
  • 87
  • 74
1

In reality, .git directories are smaller than .svn because git compresses data well and doesn't keep in it some useless snapshots due to its design. And it uses deltas too !

Cydonia7
  • 3,744
  • 2
  • 23
  • 32