動作環境/前提条件

EGitインストール

SSH認証鍵生成

$ ssh-keygen -t rsa -C yjshimojo@gmail.com
Generating public/private rsa key pair.
Enter file in which to save the key (/home/y.shimojo/.ssh/id_rsa): [dir]/id_rsa    // 鍵を保存するディレクトリを指定
Enter passphrase (empty for no passphrase):    // パスワード入力
Enter same passphrase again:    // パスワード再入力
$ cat id_rsa.pub
  1. GitHubログイン >> Personal settings >> SSH keys >> Add SSH key >> id_rsa.pubを追加
  2. Title: ローカルマシン名など
  3. Key: クリップボードの中身(SSH公開鍵情報)をペースト

Eclipseの公開鍵認証設定

  1. ウィンドウ >> 設定 >> 一般 >> ネットワーク接続 >> SSH2
  2. SSH2ホーム: SSH公開鍵の保管先を指定
  3. 秘密鍵: id_rsa
  4. 認証方法の「password」チェックを除外

EGitの初期設定

  1. ウィンドウ >> 設定 >> チーム >> Git >> 構成 >> エントリーの追加
  2. key: user.name / value: Yuji Shimojo
  3. key: user.email / value: yjshimojo@gmail.com
  4. 適用を選択

既存ワークスペースのプロジェクトからローカルリポジトリを作成

  1. パッケージ・エクスプローラー >> プロジェクト選択
  2. 右クリック >> チーム >> プロジェクトの共用 >> Git >> 作成

ローカルリポジトリへコミット

  1. 任意のGitリポジトリーを選択
  2. 右クリック >> コミット >> src配下のみ選択
  3. 右クリック >> Init Git Flow
  4. developブランチ⇒masterブランチへ切り替え

リモートリポジトリへプッシュ

  1. GitHubリポジトリー作成 ※「Initialize this repository with a README」にはチェックしない
  2. リモート >> プッシュ >> GitHubの認証情報を入力

GitHub + Cygwin 接続設定(参考)

$ vi ~/.ssh/config
Host github.com
    HostName github.com
    User git
    IdentityFile ~/.ssh/id_rsa.github
    Port 22
$ ssh-add ~/.ssh/id_rsa.github
$ ssh-add ~/.ssh/id_rsa.github
Could not open a connection to your authentication agent.
$ eval `ssh-agent -s`
$ ssh-add ~/.ssh/id_rsa.github
Enter passphrase for /home/y.shimojo/.ssh/id_rsa.github:
Identity added: /home/y.shimojo/.ssh/id_rsa.github (/home/y.shimojo/.ssh/id_rsa.github)
$ ssh git@github.com
The authenticity of host 'github.com (192.30.252.129)' can't be established.
RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'github.com,192.30.252.129' (RSA) to the list of known hosts.
PTY allocation request failed on channel 0
Hi yujishimojo! You've successfully authenticated, but GitHub does not provide shell access.
Connection to github.com closed.
$ git init
$ git add .
$ git commit -m "initial commit"
$ git remote add origin git@github.com:yujishimojo/[repo].git
$ git push -u origin master

トップ   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS