環境
- Windows
- Fork
手順
GitHubにSSHで接続する
Fork で File > Configure SSH Keys... でウィンドウを開く。
※ Forkで使うGit のInstanceを変更してるとこける
「Copy to clipboard」して、 https://github.com/settings/keys を開いて「New SSH Key」から適当な名前をつけてKeyにペーストして追加する。
ファイルは C:\Users\<User Name>\.ssh
フォルダに生成されている。
- sample : 秘密鍵
- sample.pub : 公開鍵
登録したキーはFork上でremoveできないので、ファイルを直接削除すれば消える。
クローン済みのリポジトリ
リポジトリをタブで開いてConsoleを起動する。
git remote -v
で現在の接続を確認できる。
$ git remote -v origin https://github.com/yotiky/hogehoge.git (fetch) origin https://github.com/yotiky/hogehoge.git (push)
git remote set-url
で変更。
git remote set-url origin git@github.com:yotiky/hogehoge.git
Unity の設定
以下参考に。
PowerShellを管理者権限で起動して、C:\Users\<User Name>\.ssh
に移動する。
ssh-add
は、キー名をデフォルト「id_rsa」にした場合は引数なし、別の名前にした場合は引数で秘密鍵のファイル名を指定する。
終わったら以下のコマンドで確認する。
ssh -T git@github.com Hi yotiky! You've successfully authenticated, but GitHub does not provide shell access.