Skip to content

Instantly share code, notes, and snippets.

View mav2287's full-sized avatar
🎯
Focused

James mav2287

🎯
Focused
View GitHub Profile
@mav2287
mav2287 / ComposerGitHubPrivateRepoSSH
Last active October 20, 2021 03:21 — forked from vhermecz/custom_keys_git_ssh
Allow configuring multiple ssh deploy keys with git
#!/bin/bash
# Script to use custom ssh keys for various git repositories
# Run without arguments to get usage info.
#
# How it works:
# When used with SSH, git sends the path to the repository in the SSH command.
# @see: https://github.com/git/git/blob/e870325/connect.c#L1268
# We extract this info and search for a key with the name.
# Based on the source, this seems to be used format since v2.0 at least.
# @see: https://github.com/git/git/commit/a2036d7