GPG sign issue when commiting the message
error: gpg failed to sign the data
fatal: failed to write commit object
sudo apt install -y pinentry-tty && \
sudo update-alternatives --config pinentry
and select /usr/bin/pinentry-tty for tty mode.
Even after this the problem persists then run and add the following line to your ~/.bashrc
or ~/.zshrc
file
export GPG_TTY=$(tty)