Follow this GitLab tutorial or this GitHub tutorial.
You can set the git signing settings on a per-project base.
Use the following commands to sign the commits in a project with your gpg key.
git config user.signingkey YOURKEY
git config commit.gpgsign true
To use git signing with your IDE, you will have to edit your GnuPG configuration.
Add these lines to the end of your configuration: