目录 搜索
Guides gitattributes giteveryday gitglossary gitignore gitmodules gitrevisions gittutorial gitworkflows Administration git archive git bundle git clean git filter-branch git fsck git gc git instaweb git reflog Basic Snapshotting git add git commit git diff git mv git reset git rm git status Branching and Merging git branch git checkout git log git merge git mergetool git stash git tag Debugging git bisect git blame git grep Email git am git format-patch git request-pull git send-email External Systems git fast-import git svn Getting and Creating Projects git clone git init Git git annotate git archimport git bisect-lk2009 git check-attr git check-mailmap git check-ref-format git checkout-index git cherry git citool git column git credential git credential-cache git credential-store git cvsexportcommit git cvsimport git cvsserver git diff-files git diff-tree git difftool git fast-export git fetch-pack git fmt-merge-msg git get-tar-commit-id git gui git http-backend git http-fetch git http-push git imap-send git index-pack git interpret-trailers git ls-remote git ls-tree git mailinfo git mailsplit git merge-file git merge-index git merge-one-file git merge-tree git mktag git mktree git name-rev git notes git p4 git pack-objects git pack-redundant git pack-refs git parse-remote git patch-id git prune git prune-packed git quiltimport git receive-pack git remote-ext git remote-fd git remote-testgit git repack git replace git rerere git send-pack git sh-i18n git sh-setup git shell git show-branch git show-index git stripspace git unpack-file git unpack-objects git upload-archive git upload-pack git var git verify-commit git verify-tag git whatchanged git worktree Inspection and Comparison git describe git shortlog git show Miscellaneous api credentials api index gitcli gitcore tutorial gitcredentials gitcvs migration gitdiffcore githooks gitk gitnamespaces gitremote helpers gitrepository layout gitsubmodules gittutorial 2 gitweb gitweb.conf pack format User Manual Patching git apply git cherry-pick git rebase git revert Plumbing Commands git cat-file git check-ignore git commit-tree git count-objects git diff-index git for-each-ref git hash-object git ls-files git merge-base git read-tree git rev-list git rev-parse git show-ref git symbolic-ref git update-index git update-ref git verify-pack git write-tree Server Admin git daemon git update-server-info Setup and Config git git config git help Sharing and Updating Projects git fetch git pull git push git remote git submodule
文字

名称

git-pack-refs  - 打包标头和标签以便高效的存储库访问

概要

git pack-refs [--all] [--no-prune]

描述

传统上,分支和标签(统称为refs)的提示每个参考文件存储在目录下的(子)$GIT_DIR/refs目录中。尽管许多分支技巧往往会经常更新,但大多数标签和一些分支技巧从未更新过。当一个存储库有数百或数千个标签时,这种每文件一格式的格式既浪费存储空间又损害性能。

该命令用于通过将 ref 存储在单个文件中来解决存储和性能问题,$GIT_DIR/packed-refs。如果传统$GIT_DIR/refs目录层次结构中缺少 ref ,则会在此文件中查找并在找到时使用。

对分支的后续更新总是在$GIT_DIR/refs目录层次结构下创建新文件。

一个推荐的做法是处理一个资料库太多的参考文献,它只--all会将其参考文献打包一次,偶尔也会运行git pack-refs。标签根据定义是固定的,预计不会改变。分行负责人将收集最初的pack-refs --all,但只有当前活跃的分行负责人将被解包,而下一个pack-refs(不含--all)将使他们解包。

选项

--all

该命令默认打包已经打包的所有标签和引用,并且仅保留其他引用。这是因为分支机构预计会积极开发,打包他们的提示无助于性能。此选项也会导致分支提示被打包。用于具有许多历史兴趣分支的存储库。

--no-prune

这个命令通常会$GIT_DIR/refs在打包它们之后删除松散参考。这个选项告诉它不要。

错误

在引入packed-refs机制之前编写的旧文档可能仍然表示“.git / refs / heads / <branch>文件存在”,意思是“分支<分支>存在”。

上一篇: 下一篇: