'GPG key works only for a few minutes

I use my GPG key to commit to GitHub but every time I want to commit again (for the first time in a new terminal) It asks me for a password every time.

How do I fix that I don't need to enter my password every time on my own machine.

I am using MacOS with ZSH terminal.

EDIT: I don't have a conf file. I don't know where it is located. I installed gpg with brew install gnupg Files inside ~./gnupg/ >> https://i.stack.imgur.com/B8pyX.png



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source