Typically you'd have run ssh-keygen once to create a single ssh private key in
~/.ssh/id_rsa, paired with a single matching public key in
~/.ssh/id_rsa.pub. Then you'd install that one public key on each of the machines you need to ssh into. For instance, if it's a git repo on a Unix-like machine, you'd append your public key onto
~/.ssh/authorized_keys in the home directory of your account on that server.
The typical way
ssh works is that you have a single private-public key pair that represents you, and you keep the private key private, but you install the public key into all the accounts on all the servers you need to access.
After that you could
ssh into that machine, or clone a repo via
git clone ssh://... or whatever, without being prompted for a password.
It sounds like rather than setting up
ssh the typical way as I described above, you've instead generated two separate private-public key pairs, and they're not in your
~/.ssh/ folder, and so
ssh isn't able to find them normally. It sounds like you've installed two separate public keys in other servers, one in each of the two git repo servers. It also sounds like you fired up
ssh-agent and used
ssh-add with arguments to tell it about some alternative location where it could find your private-public key pairs. So every time you log out or reboot,
ssh-agent gets quit, and so you have to manually re-run
ssh-add each time.
This explanation of what's going on for you seems more likely to me than the idea that something is deleting
~/.ssh/ each time you reboot.
If I were you, I'd pick one of my two pairs of keys to be my identity, put that pair into
~/.ssh/, install the public key from that one pair onto both git repo servers, and not bother with
ssh-add at all.
Note, however, that there's one additional step you'd need to do, IF your username on the git repo servers is different than your username that you're using for you local account on your client machine. You'd need to create a
~/.ssh/config file to let
ssh know what username to use when connecting to those other machines. The format is very simple: