若你使用 Git 時需要獲取幫助,有三種等價的方法可以找到 Git 命令的綜合手冊(manpage):
$ git help <verb> $ git <verb> --help $ man git-<verb>
例如,要想獲得 git config
命令的手冊,執行
$ git help config
這些命令很棒,因為你隨時隨地可以使用而無需聯網。 如果你覺得手冊或者本書的內容還不夠用,你可以嘗試在 Freenode IRC 服務器 https://freenode.net 上的 #git
或 #github
頻道尋求幫助。 這些頻道經常有上百人在線,他們都精通 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 --chmod (+|-)x override the executable bit of the listed files