diff options
author | John Cai <johncai86@gmail.com> | 2023-05-12 23:34:41 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-05-12 23:54:14 +0200 |
commit | 826ae79fca263bc2b70c54fddacb1603c5ebb9c6 (patch) | |
tree | f0a65557626ded284ed05b538dc0f886c067eb82 /Documentation/git-pack-refs.txt | |
parent | docs: clarify git-pack-refs --all will pack all refs (diff) | |
download | git-826ae79fca263bc2b70c54fddacb1603c5ebb9c6.tar.xz git-826ae79fca263bc2b70c54fddacb1603c5ebb9c6.zip |
pack-refs: teach --exclude option to exclude refs from being packed
At GitLab, we have a system that creates ephemeral internal refs that
don't live long before getting deleted. Having an option to exclude
certain refs from a packed-refs file allows these internal references to
be deleted much more efficiently.
Add an --exclude option to the pack-refs builtin, and use the ref
exclusions API to exclude certain refs from being packed into the final
packed-refs file
Signed-off-by: John Cai <johncai86@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/git-pack-refs.txt')
-rw-r--r-- | Documentation/git-pack-refs.txt | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/Documentation/git-pack-refs.txt b/Documentation/git-pack-refs.txt index 22f0066500..546aa122df 100644 --- a/Documentation/git-pack-refs.txt +++ b/Documentation/git-pack-refs.txt @@ -8,7 +8,7 @@ git-pack-refs - Pack heads and tags for efficient repository access SYNOPSIS -------- [verse] -'git pack-refs' [--all] [--no-prune] +'git pack-refs' [--all] [--no-prune] [--exclude <pattern>] DESCRIPTION ----------- @@ -60,6 +60,16 @@ with many branches of historical interests. The command usually removes loose refs under `$GIT_DIR/refs` hierarchy after packing them. This option tells it not to. +--exclude <pattern>:: + +Do not pack refs matching the given `glob(7)` pattern. Repetitions of this option +accumulate exclusion patterns. Use `--no-exclude` to clear and reset the list of +patterns. If a ref is already packed, including it with `--exclude` will not +unpack it. + +When used with `--all`, pack only loose refs which do not match any of +the provided `--exclude` patterns. + BUGS ---- |