質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
Git

Gitはオープンソースの分散バージョン管理システム(DVCS)です。

GitHub

GitHubは、Gitバージョン管理システムを利用したソフトウェア開発向けの共有ウェブサービスです。GitHub商用プランおよびオープンソースプロジェクト向けの無料アカウントを提供しています。

GitLab

GitLabは Gitoliteをブラウザから管理できるようにする Rubyアプリケーションで、 GitHubのようなサービスをクローズドな環境に独自で構築できるように 公開されたものです。

Q&A

3回答

9217閲覧

Gitが使えるか確認するコマンド

dog57

総合スコア131

Git

Gitはオープンソースの分散バージョン管理システム(DVCS)です。

GitHub

GitHubは、Gitバージョン管理システムを利用したソフトウェア開発向けの共有ウェブサービスです。GitHub商用プランおよびオープンソースプロジェクト向けの無料アカウントを提供しています。

GitLab

GitLabは Gitoliteをブラウザから管理できるようにする Rubyアプリケーションで、 GitHubのようなサービスをクローズドな環境に独自で構築できるように 公開されたものです。

0グッド

0クリップ

投稿2018/05/16 10:25

Gitが使えるか確認するコマンドについてご質問がございます。

git --version

以外で、Gitが使えるか判別できるコマンドはありますか?

ご教授いただけると嬉しいです。
よろしくお願い致します。

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

num79kill

2018/05/16 10:38

今回の質問に githubやgitlabのタグは不要です
guest

回答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

miyabi-sun

総合スコア21158

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

0

debian系であればですが、

sudo apt list | grep git | grep インストール

だとバージョンなどが詳しくわかります。
イメージ説明

投稿2018/08/26 17:47

odenn

総合スコア16

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

0

man git
which git

以下略

投稿2018/05/16 10:34

num79kill

総合スコア50

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだベストアンサーが選ばれていません

会員登録して回答してみよう

アカウントをお持ちの方は

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問