I am trying to get the "Verified" badge on my GitHub commits, but only for repositories located in a specific folder.
On my work computer, I have some personal GitHub repositories and work repositories (private GitLab).
I want to configure Git conditionally based on the folder where the repository is stored, so I don't have to manually set the Git configuration for each repository.
For example
~/work/**
--> Should use my work email and doesn't need to sign commit~/perso/**
--> Should use my github mail and sign commit with ssh keyAfter searching, here is a quick way:
ssh-keygen -t rsa -f ~/.ssh/github_id_rsa
[user]
name = John Doe
email = john@company.com # Your work email
[includeIf "gitdir:~/perso/"]
path = ~/.gitconfig-github
# Rest of your configuration...
[user]
name = UsernameGithub
email = 000000+user@users.noreply.github.com # your github email
signingkey = ~/.ssh/github_id_rsa.pub
[gpg]
format = ssh
[commit]
gpgsign = true