LoginSignup
26
26

Gitのインストール方法(Windows版)

Last updated at Posted at 2022-07-26

初めに

Windows版のGitのインストール方法についてまとめます。

手順No 方法
手順1 インストーラのダウンロード
手順2 Gitのインストール
手順3 Gitの設定

手順1:インストーラのダウンロード

以下からGitのインストーラーをローカルにインストールしてください。

以下のような画面に遷移すると思います。
image.png

Download」をクリックしてください。
image.png

Downloadボタンのクリックと同時に「Git-2.37.1-64-bit.exe」がダウンロードされます。(※数分かかります
image.png

手順2:Gitのインストール

手順1でダウンロードしたインストーラ(Git-2.37.1-64-bit.exe)を実行してください。
image.png
Next」をクリックしてください。
image.png
Next」をクリックしてください。
image.png
Next」をクリックしてください。
image.png
Next」をクリックしてください。
image.png
Git関連のファイルを開く際にデフォルトのエディタを設定します。任意のエディタを指定してください。
image.png
Next」をクリックしてください。(本記事では Use Visual Studio Code as Git's default editor を指定しています。)
image.png
新規リポジトリ作成時のブランチの名前を自動で決める場合は「Let Git decide」を選択し、自分で決める場合は「Override the default branch name for new repositories」を選択して、「Next」をクリックしてください。
image.png
Git from the command line and also from 3rd-party software」を選択して、「Next」をクリックしてください。
image.png
Use bundled OpenSSL」を選択して、「Next」をクリックしてください。
image.png
Use the OpenSSL library」を選択して、「Next」をクリックしてください。
image.png
Checkout Windows-style, commit Unix-style line endings」を選択して、「Next」をクリックしてください。
image.png
Use MinTTY (the default terminal of MSYS2」を選択して、「Next」をクリックしてください。
image.png
Default (fast-forward or merge)」を選択して、「Next」をクリックしてください。
image.png
Git Credential Manager」を選択して、「Next」をクリックしてください。
image.png
両方チェックして、「Next」をクリックしてください。
image.png
何もチェックせず、「Install」をクリックしてください。
image.png
インストールが開始されます。
image.png
以下のように表示されたらインストール完了です。
image.png
スタートメニューなどで「Git Bash」が表示されていたらインストール成功です。
image.png

手順3:Gitの設定

Gitのアカウントを持っていない場合は以下から作成をしてください。

ユーザー名とメールアドレスを設定します。
Git Bashを実行して、以下のコマンドを実行してください。

ユーザ名の設定コマンド
git config --global user.name "ユーザー名は任意"
メールアドレスの設定コマンド
git config --global user.email "メールアドレス"

SSHキーを作成します。

ssh-keygen

SSHキーの保存先、パスワードを指定します。デフォルトで問題ない場合は何も入力せずにEnterを押してください。

Generating public/private rsa key pair.
Enter file in which to save the key (/c/Users/????/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:

追記

Gitの基本操作について、記載しました。

26
26
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
26
26