LoginSignup
3
1

More than 3 years have passed since last update.

Cloud Source RepositoriesをCloud SDK抜きのSSH認証で使う

Last updated at Posted at 2019-06-04

の通り。ベータ版らしい。Cloud Source Repositories特有の手順や問題は特にない。リポジトリを作ったら

ssh-keygen -t rsa -C "${USER_EMAIL}" -f ~/.ssh/id_rsa_google

みたいに鍵を生成して

https://source.cloud.google.com/user/ssh_keys
からid_rsa_google.pubの中身を登録して

Host source.developers.google.com
 HostName source.developers.google.com
 Port 2022
 IdentityFile ~/.ssh/id_rsa_google

みたいにssh config書いて

git remote add google ssh://${USER_EMAIL}@source.developers.google.com:2022/p/${PROJECT_ID}/r/${RESPOSITORY_NAME}

ローカルリポジトリにremoteとして追加して(空リポジトリの場合はコピペ用コマンドがリポジトリ管理画面に表示される)
スクリーンショット 2019-06-04 16.39.02.png
(唯一のremoteなら別に"google"じゃなく"origin"でもいいと思う)

git push --all google

すればok

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