MacBook Pro shows machine name as Mac-mini in public key
When I checked my public key, it shows ssh-rsa mykey [email protected]
But I'm using macbook pro. Also hostname is correct. My old machine was mac mini.
My guess is that your old keypair got copied over to the new machine (possibly when you restored from a Time Machine backup or even just manually copied over your user directory).
Either way, that string at the end is just an identifying string; it won't affect your ability to use the key from your new machine as long as you are using the matching private key to connect to servers on which that old public key is installed. That said, if the username on your local machine doesn't match the username on the remote host, you'll have to specify the remote host username when trying to connect via SSH.
If you really want to, you can generate a new keypair and upload the new public key to servers you need to access; that new public key will have your MacBook Pro username and MBP identifier appended to it.