章 ▾ 第2版

1.7 Gitの導入 - ヘルプの利用

ヘルプの利用

Gitの使用中にヘルプが必要になった場合、どのGitコマンドについても、網羅的なマニュアルページ(manページ)のヘルプを得るには、3つの同等の方法があります

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

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

$ git help config

これらのコマンドは、オフラインでもどこからでもアクセスできるため便利です。マニュアルページやこの書籍だけでは不十分で、対面でのヘルプが必要な場合は、Libera Chat IRCサーバーの`#git`、`#github`、または`#gitlab`チャンネルを試すことができます。サーバーはhttps://libera.chat/で見つけられます。これらのチャンネルには、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