init

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Initialize git-pkgs

初始化git-pkgs

Set up and maintain the git-pkgs dependency database for a repository.
为仓库设置并维护git-pkgs依赖数据库。

Commands

命令

First-time setup (walks git history, builds SQLite database in
.git/pkgs.sqlite3
):
bash
git-pkgs init
Options:
  • --branch=NAME
    - analyze a specific branch
  • --since=SHA
    - start from a specific commit
  • --force
    - rebuild from scratch
  • --no-hooks
    - skip installing git hooks
Update after pulling new commits:
bash
git-pkgs reindex
Check database status:
bash
git-pkgs info
Upgrade database schema (rebuilds if schema changed):
bash
git-pkgs upgrade
Manage git hooks for automatic reindexing:
bash
git-pkgs hooks install
git-pkgs hooks remove
List supported ecosystems:
bash
git-pkgs ecosystems
首次设置(遍历git历史记录,在
.git/pkgs.sqlite3
中构建SQLite数据库):
bash
git-pkgs init
选项:
  • --branch=NAME
    - 分析特定分支
  • --since=SHA
    - 从特定提交开始
  • --force
    - 从头重建
  • --no-hooks
    - 跳过安装git钩子
拉取新提交后更新:
bash
git-pkgs reindex
检查数据库状态:
bash
git-pkgs info
升级数据库架构(若架构变更则重建):
bash
git-pkgs upgrade
管理git钩子以实现自动重新索引:
bash
git-pkgs hooks install
git-pkgs hooks remove
列出支持的生态系统:
bash
git-pkgs ecosystems

When to use

使用场景

  • When a user wants to start tracking dependencies in a repo
  • When
    git-pkgs
    commands fail because no database exists
  • After pulling or rebasing to update the index
  • When the database needs upgrading after a git-pkgs version update
  • 当用户想要开始跟踪仓库中的依赖项时
  • 因不存在数据库导致
    git-pkgs
    命令执行失败时
  • 拉取或变基后需要更新索引时
  • git-pkgs版本更新后需要升级数据库时