mabulog

このブログは、mabuの平凡な日常を淡々と描く物です。 過度な期待はしないでください。 あと、部屋は明るくして、 モニターから3メートルは離れて見やがってください。

Used GitHub

背景 Background

昔、GitHubを使っていたのに使い方を忘れしまったので、
忘れないためのメモです。

目標 Goal

  • pushまでCUIで行える事

環境 Environment

GitHub 事前準備

  • アカウント
    • ユーザ名
      ex) KazuakiM
    • メールアドレス
      ex) sample@sample.com
  • レポジトリ
    ex) mySettingFiles

手順 Operation

公開鍵をGitHubに登録

GitHubにログインし、作成した公開鍵の内容をSSH Keysページで登録する。

$ cd
$ ssh-keygen
$ cat .ssh/id_rsa.pub
ssh-rsa asdfasd........................
....== mabulog@localhost.localdomain

".bash_profile"設定

$ cd
$ vi .bash_profile
unset SSH_ASKPASS

初回 push

$ cd
$ mkdir -p work/mySettingFiles
$ cd work/mySettingFiles
$ git config --global user.name "KazuakiM"
$ git config --global user.email "sample@sample.com"
$ git clone https://github.com/KazuakiM/mySettingFiles.git
$ git add .vimrc
$ git commit -a -m 'first commit'
$ vi .git/config
#url = https://github.com/KazuakiM/mySettingFiles.git
url = https://KazuakiM@github.com/KazuakiM/mySettingFiles.git

$ git push origin master
Password:**********************

2回目 push (ファイル更新)

$ git commit -a -m 'second commit'
$ git push origin master
Password:**********************

エラー Error

$ git push -u origin master

(gnome-ssh-askpass:2561): Gtk-WARNING **: cannot open display:

いろいろな解決策があると思われます。
以前、GUIを使用していた時はこんな設定した記憶が無いため、
要検討項目です。

$ vi .bash_profile
unset SSH_ASKPASS

参考サイト Reference