Skip to content

Instantly share code, notes, and snippets.

@liyaodong
Created November 18, 2021 08:01
Show Gist options
  • Save liyaodong/a37354cf2035a018b540fa2f4002dde6 to your computer and use it in GitHub Desktop.
Save liyaodong/a37354cf2035a018b540fa2f4002dde6 to your computer and use it in GitHub Desktop.
setup ssh key per project
Host github-my-repo
# The host that has the remote Git repository
Hostname github.com
# Username for remote SSH user (For GitHub, everyone uses the name `git`)
User git
# Path to your private SSH key
IdentityFile /root/.ssh/github-my-repo.id.rsa
change repo ssh config from
git@github.com:xxx/xxx.git
to
github-my-repo:xxx/xxx.git
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment