This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Git использует zlib для сжатия содержимого этих файлов; к тому же у нас не так много данных, поэтому все эти файлы вместе занимают всего 925 байт.
Git использует `zlib` для сжатия содержимого этих файлов; к тому же у нас не так много данных, поэтому все эти файлы вместе занимают всего 925 байт.
Для того, чтобы продемонстрировать одну интересную особенность Git, добавим файл побольше.
Добавим файл `repo.rb` из библиотеки Grit -- он занимает примерно 22 Кб:
Expand Down
Expand Up
@@ -123,7 +123,7 @@ Pack-файл -- это файл, в котором теперь находит
Как Git это делает?
При упаковке Git ищет похожие по имени и размеру файлы и сохраняет только разницу между соседними версиями.
Можно заглянуть в pack-файл чтобы понять, какие действия выполняются при сжатии.
Можно заглянуть в pack-файл, чтобы понять, какие действия выполняются при сжатии.
Для просмотра содержимого упакованного файла существует служебная команда `git verify-pack`:
[source,console]
Expand Down
Expand Up
@@ -160,4 +160,4 @@ chain length = 1: 3 objects
Что интересно, вторая версия файла сохраняется «как есть», а первая -- в виде дельты: ведь скорее всего вам понадобится быстрый доступ к самым последним версиям файла.
Также здорово, что переупаковку можно выполнять в любое время.
Время от времени Git будет выполнять её автоматически, чтобы сэкономить место на диске, но всегда можно инициировать упаковку вручную используя `git gc`.
Время от времени Git будет выполнять её автоматически, чтобы сэкономить место на диске, но всегда можно инициировать упаковку вручную, используя `git gc`.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
10/git-internals: мелкие правки #525
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Are you sure you want to change the base?
Uh oh!
There was an error while loading. Please reload this page.
10/git-internals: мелкие правки #525
Filter by extension
Viewed files
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There are no files selected for viewing
Uh oh!
There was an error while loading. Please reload this page.