diff --git a/extensions/git/src/commands.ts b/extensions/git/src/commands.ts index 52a752a..c710486 100644 --- a/extensions/git/src/commands.ts +++ b/extensions/git/src/commands.ts @@ -2458,9 +2458,15 @@ export class CommandCenter { } } - // Enable signing of commits if the setting is enabled. If the setting is not enabled, - // we set the option to undefined so that we let git use the repository/global config. - opts.signCommit = config.get('enableCommitSigning') === true ? true : undefined; + // Enable signing of commits if the setting is enabled, unless signing has been explicitly + // disabled in the repository config. Otherwise, we set the option to undefined so that we + // let git use the repository/global config. + opts.signCommit = undefined; + + if (config.get('enableCommitSigning') === true) { + const commitGpgSign = await repository.getConfig('commit.gpgsign'); + opts.signCommit = /^(false|no|off|0)$/i.test(commitGpgSign) ? undefined : true; + } if (config.get('alwaysSignOff')) { opts.signoff = true;