Gitが使えるか確認するコマンドについてご質問がございます。
git --version
以外で、Gitが使えるか判別できるコマンドはありますか?
ご教授いただけると嬉しいです。
よろしくお願い致します。
気になる質問をクリップする
クリップした質問は、後からいつでもMYページで確認できます。
またクリップした質問に回答があった際、通知やメールを受け取ることができます。
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
今回の質問に githubやgitlabのタグは不要です

回答3件
0
普通に存在しないコマンドを打ち込むと
そんなコマンド存在しねーよエラーが出ます。
gitと入力して使い方説明書がずらずら表示されれば大丈夫です。
Bash
1$ hoge 2bash: hoge: command not found 3 4$ git 5usage: git [--version] [--help] [-C <path>] [-c name=value] 6 [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path] 7 [-p | --paginate | --no-pager] [--no-replace-objects] [--bare] 8 [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>] 9 <command> [<args>] 10 11These are common Git commands used in various situations: 12 13start a working area (see also: git help tutorial) 14 clone Clone a repository into a new directory 15 init Create an empty Git repository or reinitialize an existing one 16 17work on the current change (see also: git help everyday) 18 add Add file contents to the index 19 mv Move or rename a file, a directory, or a symlink 20 reset Reset current HEAD to the specified state 21 rm Remove files from the working tree and from the index 22 23examine the history and state (see also: git help revisions) 24 bisect Use binary search to find the commit that introduced a bug 25 grep Print lines matching a pattern 26 log Show commit logs 27 show Show various types of objects 28 status Show the working tree status 29 30grow, mark and tweak your common history 31 branch List, create, or delete branches 32 checkout Switch branches or restore working tree files 33 commit Record changes to the repository 34 diff Show changes between commits, commit and working tree, etc 35 merge Join two or more development histories together 36 rebase Reapply commits on top of another base tip 37 tag Create, list, delete or verify a tag object signed with GPG 38 39collaborate (see also: git help workflows) 40 fetch Download objects and refs from another repository 41 pull Fetch from and integrate with another repository or a local branch 42 push Update remote refs along with associated objects 43 44'git help -a' and 'git help -g' list available subcommands and some 45concept guides. See 'git help <command>' or 'git help <concept>' 46to read about a specific subcommand or concept.
そうではなく、シェルスクリプト内で自動的に存在するか否かを確認したい場合、
Linuxのシス管系女子を連載しているPiro氏曰くcommand -v
が良いそうです。
ディストリビューションをまたいで多くの環境に入ってるそうです。
他の選択肢も色々とあります。
「command 存在確認」などといった単語で検索してみてください。
以下はその一例の記事です。
投稿2018/05/16 10:35
総合スコア21395
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
あなたの回答
tips
太字
斜体
打ち消し線
見出し
引用テキストの挿入
コードの挿入
リンクの挿入
リストの挿入
番号リストの挿入
表の挿入
水平線の挿入
プレビュー
質問の解決につながる回答をしましょう。 サンプルコードなど、より具体的な説明があると質問者の理解の助けになります。 また、読む側のことを考えた、分かりやすい文章を心がけましょう。