TIL git config core.sshCommand
TIL here that git provides a config for core.sshCommand
.
I was already splitting my personal and work git user configuration by path with this setting in my ~/.gitconfig
.
So adding the block below simplified my .ssh/config
and my cloning/pushing.
[core]
sshCommand = "ssh -i ~/.ssh/id_ed25519_personal -F /dev/null"
~/.gitconfig
[include]
path = ~/dotfiles/gituser_work.include
[includeIf "gitdir/i:~/dotfiles/"]
path = ~/dotfiles/gituser_personal.include
gituser_work.include
[user]
name = Your Full Name
email = your@work-email.com
gituser_personal.include
[user]
name = Your Full Name
email = your@personal-email.com
[core]
sshCommand = "ssh -i ~/.ssh/id_ed25519_personal -F /dev/null"
Top comments (0)