Yubikey GPG

It integrates seamlessly with the Systemd’s pre-defined units. But you might want to sign your commits automatically with GPG. For that purpose, create a .gitconfig on your home folder as follows.

[user]
	name = David Peralta
	email = david@daper.email
	signingkey = <signing-key-id>

[pull]
	rebase = true
[gpg]
	program = gpg2
[commit]
	gpgsign = true
[init]
	defaultBranch = main

[includeIf "gitdir:~/Software/<folder-to-exclude>/"]
	path = ~/.gitconfig_other

[color]
	ui = auto

The includeIf section is to exclude everything under the specified path from signing or to sign it with other key. Create the ~/.gitconfig_other with the following content.

[user]
	email = david@example.org

[commit]
	gpgsign = false