Git

NOME

git-pack-refs - Embale os cabeçalhos e a tags do pacote para acesso eficiente ao repositório

RESUMO

git pack-refs [--all] [--no-prune] [--include <padrão>] [--exclude <padrão>]

DESCRIÇÃO

Traditionally, tips of branches and tags (collectively known as refs) were stored one file per ref in a (sub)directory under $GIT_DIR/refs directory. While many branch tips tend to be updated often, most tags and some branch tips are never updated. When a repository has hundreds or thousands of tags, this one-file-per-ref format both wastes storage and hurts performance.

This command is used to solve the storage and performance problem by storing the refs in a single file, $GIT_DIR/packed-refs. When a ref is missing from the traditional $GIT_DIR/refs directory hierarchy, it is looked up in this file and used if found.

Atualizações subsequentes nos ramos sempre criam novos arquivos na hierarquia de diretórios $GIT_DIR/refs.

A recommended practice to deal with a repository with too many refs is to pack its refs with --all once, and occasionally run git pack-refs. Tags are by definition stationary and are not expected to change. Branch heads will be packed with the initial pack-refs --all, but only the currently active branch heads will become unpacked, and the next pack-refs (without --all) will leave them unpacked.

OPÇÕES

--all

The command by default packs all tags and refs that are already packed, and leaves other refs alone. This is because branches are expected to be actively developed and packing their tips does not help performance. This option causes all refs to be packed as well, with the exception of hidden refs, broken refs, and symbolic refs. Useful for a repository with many branches of historical interests.

--no-prune

The command usually removes loose refs under $GIT_DIR/refs hierarchy after packing them. This option tells it not to.

--include <padrão>

Empacota refs com base num padrão glob(7). As repetições dessa opção acumulam padrões de inclusão. Se uma referência estiver incluída tanto em --include quanto em --exclude, a opção --exclude tem precedência. Por padrão, o uso da opção --include impedirá que todas as tags sejam incluídas. os refs simbólicos e os refs quebrados nunca serão empacotados. Quando usado com --all, será um noop. Use --no-include para limpar e redefinir a lista de padrões.

--exclude <padrão>

Não empacote refs que correspondam ao padrão glob(7) fornecido. As repetições dessa opção acumulam padrões de exclusão. Use --no-exclude para limpar e redefinir a lista de padrões. Se uma ref já estiver empacotada, ao incluí-la com a opção --exclude não a desempacotará.

Quando usado com --all, empacota apenas as refs soltas que não correspondem a nenhum dos padrões --exclude fornecidos.

Quando usado com a opção --include, as refs fornecidas para a opção --include, menos as refs que sejam fornecidas para --exclude, serão empacotadas.

BUGS

A documentação mais antiga escrita antes da introdução do mecanismo "packed-refs" ainda pode dizer coisas como "o arquivo .git/refs/heads/<ramo> existe" quando significa "o ramo <ramo> existe".

GIT

Parte do conjunto git[1]

scroll-to-top