I'm using YubiKey for my ssh keys with gpg-agent. After some updates with homebrew (including pinentry) something odd happens. My key was in place as usual, gpg --card-status returns all as supposed. But trying to pull my repo from gitlab Pinentry always poped with me same message:

Please insert the card with serial number XXXX XXXXXXXXX

And that was my card number. All was correct.

I fixed it with the following commands:

gpg-connect-agent killagent \bye
gpg-connect-agent "scd serialno" "learn --force" \bye