3
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

GitHub (including Enterprise) 初期設定方法

Posted at

登録するアカウント

項目 設定値
名前 nippon-taro
メールアドレス nippon-taro@company.jp

設定コマンド(Linux側で実施)

公開鍵と秘密鍵を作成

git config --global user.name "nippon-taro"
git config --global user.email "nippon-taro@company.jp"

ssh-keygen -t rsa -b 4096 -C "nippon-taro@company.jp"
cat ~/.ssh/id_rsa.pub

以下2ファイルが作成される。説明は以下のとおり。

ファイル 種別 説明
id_rsa.pub 公開鍵  人に見せてもOK
id_rsa  秘密鍵 人に見せちゃダメ絶対

GitHubへ公開鍵を登録

catで開いたファイルを貼り付ける

スクリーンショット 2016-03-09 23.58.28.png

SSH keys -> New SSH key の順番にクリックする
スクリーンショット 2016-03-10 00.06.12.png

キーの入力画面が表示される。
Titleは自分が好きに名前をつける事ができる。
Keyにcatで開いたファイルを貼り付ける。
スクリーンショット 2016-03-10 00.06.35.png

設定(Linux側で実施)

eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_rsa
ls -al ~/.ssh

# 登録する設定がGitHubの場合(@以降はgithub.com)
ssh -l git -i ~/.ssh/id_rsa nippon-taro@github.com

# 登録する設定がGitHub Enterpriseの場合(@以降はカンパニードメイン)
ssh -l git -i ~/.ssh/id_rsa nippon-taro@company.jp
3
4
2

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
3
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?