Git user config per path
João Vitor
Posted on June 22, 2021
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"
💖 💪 🙅 🚩
João Vitor
Posted on June 22, 2021
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.
Related
productivity ✍️🤖 Learn How to Improve Your Prompts and Get More Detailed and Relevant Responses
November 29, 2024