2011-10-23 11 views
35

GITで利用可能なすべてのコマンドのリストを表示するコマンドはありますか?そこgit helpですが、それは示していますgitすべての利用可能なコマンドを一覧表示します

usage: git [--version] [--exec-path[=<path>]] [--html-path] 
      [-p|--paginate|--no-pager] [--no-replace-objects] 
      [--bare] [--git-dir=<path>] [--work-tree=<path>] 
      [-c name=value] [--help] 
      <command> [<args>] 

The most commonly used git commands are: 
    add  Add file contents to the index 
    bisect  Find by binary search the change that introduced a bug 
    branch  List, create, or delete branches 
    checkout Checkout a branch or paths to the working tree 
    clone  Clone a repository into a new directory 
    commit  Record changes to the repository 
    diff  Show changes between commits, commit and working tree, etc 
    fetch  Download objects and refs from another repository 
    grep  Print lines matching a pattern 
    init  Create an empty git repository or reinitialize an existing one 
    log  Show commit logs 
    merge  Join two or more development histories together 
    mv   Move or rename a file, a directory, or a symlink 
    pull  Fetch from and merge with another repository or a local branch 
    push  Update remote refs along with associated objects 
    rebase  Forward-port local commits to the updated upstream head 
    reset  Reset current HEAD to the specified state 
    rm   Remove files from the working tree and from the index 
    show  Show various types of objects 
    status  Show the working tree status 
    tag  Create, list, delete or verify a tag object signed with GPG 

See 'git help <command>' for more information on a specific command. 

そして私は説明せずに、単にリストをしたいです。

答えて

49

試してみてください。gitのコア・ディレクトリの下のすべてのファイルを一覧表示していない理由を

git help -a 

+0

これは100%ではないが、私が見つけたものよりも優れている。+1 –

+1

@ skowron-line:説明なしで利用可能なすべてのgitコマンドのリスト。あなたが求めていることではありませんか? –

+0

はい、これは私が求めたものです。 –

3

?私が意味する

ls -1 [the git core directory]

+2

gitにネイティブでないコマンド(つまり、ユーザのパスのどこかにある 'git- *'コマンド)をリストしません。 –

4

あなたは、Linux(BASH)を使用している場合。 @CharlesBaileyがすでに示唆したように、

 
$ git 
add     fetch    rebase 
am     fetchavs   reflog 
annotate   filter-branch  relink 
apply    format-patch  remote 
archive    fsck    repack 
bisect    gc     replace 
blame    get-tar-commit-id request-pull 
br     grep    reset 
branch    gui     revert 
bundle    help    rm 
checkout   imap-send   shortlog 
cherry    init    show 
cherry-pick   instaweb   show-branch 
ci     log     st 
citool    log1    stage 
clean    merge    stash 
clone    mergetool   status 
co     mv     submodule 
commit    name-rev   svn 
config    notes    tag 
describe   pull    whatchanged 
diff    push     
difftool   pushav    
+2

これは 'git help -a'を使っていると思います。 – tripleee

+0

これは利用可能なコマンドの完全なリストではありません。 'ls-remote'がありません。 – valid

+0

最初に[Git command Auto-Completion](https://git-scm.com/book/en/v1/Git-Basics-Tips-and-Tricks#Auto-Completion)を有効にする必要はありません実際に働く? – AndresM

4

git help -aがオファーをgitのサブコマンドをすべてリストするための素晴らしい方法です:あなたは、その後、私はこのような何かを得た

 
`$ git [TAB] [TAB]` 

を試すことができます。あなたがプリントをgitの書式設定の一部を削除したい場合は、それはあまりにも行うことができます。

git help -a | grep "^ [a-z]" | tr ' ' '\n' | grep -v "^$" 

これはとり:次のように

すべてのGitのサブコマンドのリストを取得する最も簡単な方法がありますgit help -aの出力では、インデントされた行のみを選択し、スペースを改行文字に変換して空の行を削除します。

なぜこのようなものが欲しいですか?コマンドのサブコマンドを一覧表示したいのための一般的な理由は、バッシュで自動補完を有効にするには、次のとおりです。

complete -W "$(git help -a | grep "^ [a-z]")" git 

さて、あなたはgit brを入力し、TABを押したときに、それはgit branchに自動的に補完します。楽しい!

+0

Gitのドキュメントから、[Gitコマンド自動補完](https:// git-scm)を簡単に有効にする別の方法があります。com/book/en/v1/Git-Basics-Tips-and-Tricks#Auto-Completion)を使用している場合はbashシェルを使用します。 – AndresM

関連する問題