LoginSignup
0
0

More than 1 year has passed since last update.

GCPのSource Repositoriesを使うためのSSHの設定

Posted at

GCPのSource Repositoriesを使うためのSSHの設定の流れです
パソコン側はWSL2を例にしてます

ssh-keygen

パスワードを聞かれるので好きなものを入力。
./sshにid_rsa(秘密鍵)、id_rsa.pub(公開鍵)が生成される。

cat id_rsa.pub

でid_rsa.pub(公開鍵)の中身を表示し、中身をコピーしておく。

gcpログインする。

Source Repositoriesの画面で右上のメニューからManage SSH Keysを選択。
右上にあるRegister SSH keyボタンを押す。
入力フィールドがあるので、てきとうな名前を入力し、公開鍵をペースト。

git clone -b develop/master ssh://<アカウント>source.developers.google.com:2022/p/<プロジェクト名>/r/<リポジトリ名>

例えば上記のようにWSL2でgitコマンドを入力すると接続しますか?と聞かれるのでyes。
鍵生成時のパスワードを入力。

0
0
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
0
0