Export the secret keys on machine A

gpg --export-secret-key -a [email protected] > my_private.key

Export your public keys on machine A

gpg --export -a [email protected] > my_public.key

Import the keys on machine B

gpg —import my_public.key
gpg —import —allow-secret-key-import my_private.key