1
2

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にssh接続する際の初期設定

Last updated at Posted at 2017-07-23

#githubにssh接続する際の初期設定
備忘録として残しておく
##gitのインストール

$sudo apt-get install git

##git 初期設定

$git config --global user.name "user"
$git config --global user.email mail.com
  • 設定確認
git config --global --list

ssh鍵作成

ssh-keygen -t rsa -C "your_email@example.com"
  • 鍵ファイル保存場所はデフォルト
  • パスワードを入力
  • id_git_rsa id_git_rsa.pubが生成される

##github にkeyを登録
https://github.com/settings/keysから
~/.ssh/id_rsa.pub の内容を登録する。

 Hi (account名)! You've successfully authenticated, but GitHub does not provide shell access.

が返って来れば成功

localリポジトリ作成

$git init
  • ステージングにアップ
git add ファイル名
  • コミット
git commit -m "メッセージ"
  • ログ確認
git log

GitHubのリポジトリ追加してpush

git remote add origin url
git push -u origin master

 

1
2
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
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?