feat: add SSH commit signing to git identities
Configure commit signing per Git identity Apply SSH signing settings automatically Support signing in web and VS Code
This commit is contained in:
@@ -1913,6 +1913,12 @@ export async function setLocalIdentity(directory, profile) {
|
||||
await git.raw(['config', '--local', '--unset', 'core.sshCommand']).catch(() => {});
|
||||
}
|
||||
|
||||
if (profile.signCommits === true && typeof profile.signingKey === 'string' && profile.signingKey.trim()) {
|
||||
await git.addConfig('gpg.format', 'ssh', false, 'local');
|
||||
await git.addConfig('user.signingkey', profile.signingKey.trim(), false, 'local');
|
||||
await git.addConfig('commit.gpgsign', 'true', false, 'local');
|
||||
}
|
||||
|
||||
return true;
|
||||
} catch (error) {
|
||||
console.error('Failed to set Git identity:', error);
|
||||
|
||||
Reference in New Issue
Block a user