チャプター ▾ 第2版

1.7 Gitの基本 - ヘルプの入手

ヘルプの入手

Gitを使用中にヘルプが必要になった場合は、Gitコマンドの包括的なマニュアルページ(manpage)ヘルプを取得するための3つの同等の方法があります。

$ git help <verb>
$ git <verb> --help
$ man git-<verb>

例えば、git configコマンドのマニュアルページヘルプは、これを実行することで取得できます。

$ git help config

これらのコマンドは、オフラインでもどこからでもアクセスできるため便利です。マニュアルページとこの本だけでは不十分で、対面でのヘルプが必要な場合は、Libera Chat IRCサーバー(https://libera.chat/)の#git#github、または#gitlabチャンネルを試すことができます。これらのチャンネルには、Gitに非常に詳しい何百人もの人々が常におり、喜んで助けてくれます。

さらに、完全なマニュアルページヘルプは必要なく、Gitコマンドで利用可能なオプションを簡単に確認したいだけであれば、-hオプションを使用して、より簡潔な「help」出力を要求できます。

$ git add -h
usage: git add [<options>] [--] <pathspec>...

    -n, --dry-run               dry run
    -v, --verbose               be verbose

    -i, --interactive           interactive picking
    -p, --patch                 select hunks interactively
    -e, --edit                  edit current diff and apply
    -f, --force                 allow adding otherwise ignored files
    -u, --update                update tracked files
    --renormalize               renormalize EOL of tracked files (implies -u)
    -N, --intent-to-add         record only the fact that the path will be added later
    -A, --all                   add changes from all tracked and untracked files
    --ignore-removal            ignore paths removed in the working tree (same as --no-all)
    --refresh                   don't add, only refresh the index
    --ignore-errors             just skip files which cannot be added because of errors
    --ignore-missing            check if - even missing - files are ignored in dry run
    --sparse                    allow updating entries outside of the sparse-checkout cone
    --chmod (+|-)x              override the executable bit of the listed files
    --pathspec-from-file <file> read pathspec from file
    --pathspec-file-nul         with --pathspec-from-file, pathspec elements are separated with NUL character
scroll-to-top