Skip to content

Instantly share code, notes, and snippets.

@karladler
Last active November 30, 2021 15:25
Show Gist options
  • Save karladler/e1a50cfb5ba091a93c4b926d925ea5d4 to your computer and use it in GitHub Desktop.
Save karladler/e1a50cfb5ba091a93c4b926d925ea5d4 to your computer and use it in GitHub Desktop.
Code Commit multi User SSH for GIT

See: https://gist.github.com/justinpawela/3a7056cd592d688425e59de2ef6f1da0

Configure SSH Accounts

in /Users/USERNAME/.ssh/config

Host myhost # Variable can be set to anything
Hostname git-codecommit.eu-central-1.amazonaws.com # Mind the region!
User APKAX4SYVAHILE7CYGZK # AWS Code Commit Key ID, you get after uploading the public key
IdentityFile ~/.ssh/code_commit # path to your public key

Host myhost2
Hostname git-codecommit.eu-central-1.amazonaws.com
User USERID2EXAMPLE
IdentityFile ~/.ssh/code_commit # or ~/.ssh/code_commit2 in case you have different keys

New urls logic

Command git clone ssh://git-codecommit.eu-central-1.amazonaws.com/v1/repos/my-repo

Becomes git clone ssh://myhost/v1/repos/my-repo

Update existing remote URLs:

git remote set-url origin ssh://myhost/v1/repos/my-repo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment