Re: GIT Performance question

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Jeff King
Date: Saturday, April 17, 2010 - 3:37 am

On Sat, Apr 17, 2010 at 01:55:49AM -0800, santos2010 wrote:


Short answer: Git does store and transfer deltas. It generally beats any
other system in terms of repo size.

Longer answer:

Git separates the concept of the history graph and the actual storage
mechanism. So conceptually the history is a directed graph of snapshots,
each representing the whole tree. But there are two things that save
space:

  1. Git addresses content by its sha1. So each snapshot may refer to a
     file by the sha1 of its content, meaning we only have to store that
     content once.

  2. Git packs "objects" (where each file's content is in a single
     object) into "packfiles", in which it aggressively deltas objects
     against each other, including objects which do not come from the
     same path in your tree.

Git will store "loose" objects when performing most operations, but will
occasionally pack when the number of objects get too high. You can also
initiate a full pack by running "git gc".

For transferring between repositories, git will figure out which parts
of the history each side has, and will only send the objects that the
other side needs. In addition, it will send them as a packfile using
delta compression, including deltas against objects that are not being
sent but that it knows the other side has.

-Peff
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
GIT Performance question, santos2010, (Sat Apr 17, 2:55 am)
Re: GIT Performance question, Geert Bosch, (Sat Apr 17, 3:37 am)
Re: GIT Performance question, Jeff King, (Sat Apr 17, 3:37 am)
Re: GIT Performance question, Dmitry Potapov, (Sat Apr 17, 3:40 am)
Re: GIT Performance question, santos2010, (Sat Apr 17, 4:21 am)
Re: GIT Performance question, Jeff King, (Sat Apr 17, 4:55 am)