1
0

GitBash初期設定(Windowsクライアント)

Last updated at Posted at 2020-05-05

#この記事について
この記事はGitHubを利用するにあたって、windowsクライアントで利用可能なgitbashの初期設定を示すものです。

#GitBashをダウンロードする

  • git(windows用)を下記からローカルPCにダウンロードする。
  • https://gitforwindows.org/
  • gitbashをインストールし、起動する。(すべて次へ:デフォルト設定でOK)

#GitBashの初期設定
下記コマンドを実行

bash
git config --global user.name "Firstname Lastname"
git config --global user.email "name@example.com"

このコマンドは「~/.gitconfig」に下記のような形で設定ファイルを出力する。

bash
[user]
name = Firstname LastName
email = name@example.com

ここで設定した名前とメールアドレスはgithubでリポジトリを公開する場合も、この名前とメールアドレスがコミットログして公開されるので、公開しても問題ないものを利用すること。
#コマンドの出力を読みやすくする

bash
git config --global color.ui auto

「~/.gitconfig」に下記の行が追加されている。

bash
[color]
 ui = color

こうするとコマンドからの出力が読みやすくなる。

#SSH Keyの設定

ssh-keygen -t rsa -C "name@example.com"

公開鍵(id_raa.pub)をgithubに登録する。
https://github.com/

##疎通確認

ssh -T git@github.com

#クライアントPCにプロジェクトをcloneする
githubからURLを取得する
2020-05-05_18-50-05.png

gitbashを起動して、ターミナルから下記のコマンド打つ。

git clone git@github.com:darcy-it/test.git
1
0
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
1
0