Storing ssh-keys in dotfiles git repo

Is it possible to have my ssh keys automatically added when I clone my git repo? I usually keep my dotfiles private, but I want them secure even if I by some accident make it public

I am not sure how common it is, but some dotfile managers have support for encrypting/decrypting files (IIRC at least chezmoi and yadm).

If you eschew dotfile managers, I guess there are more direct approaches like git-crypt as well. That said (and with the caveat that I haven’t used git-crypt), my general experience with git plugins makes me suspect that this latter approach is more likely to produce an oops than an encryption feature built into your dotfile manager…