githubのssh cloneで複数アカウントを使い分ける

公開日時
更新日時

githubでssh cloneをする際に複数アカウントを使い分けたかったので、.ssh/configに↓のように複数のHost設定を追加した。

Host github.com
  HostName github.com
  User git
  IdentityFile ~/.ssh/github_id_rsa
  IdentitiesOnly yes

Host another-github.com
  HostName github.com
  User git
  IdentityFile ~/.ssh/another_github_id_rsa
  IdentitiesOnly yes

これでclone元のurlをanother-github.comにすれば別アカウントでcloneができる。

# 1つ目のアカウントでclone
git clone git@github.com:user/repo.git

# 2つ目のアカウントでclone
git clone git@another-github.com:another-user/another-repo.git

Related #github

iPhoneで撮った写真(HEIC)をGitHubにアップロードする

GitHubアプリ上からアップロードするのが楽

MonorepoでGitHub Actionsを使う

pathsを設定することでサブディレクトリへの変更のみを検知できるようになった

Personal Access Tokenの見直し

整理した

Github ActionでfirebaseプロジェクトをS3にデプロイする

deploymentブランチにpushしたら自動でs3にデプロイできるようになった

Github ActionでCloudfrontのキャッシュをクリアする

デプロイ後にキャッシュクリアを行うように設定

GitHub app is built on Slack's workspace apps which are now deprecated

旧GitHub appは新appのインストール後に消すべきだった