错误:gpg.format 的值不受支持:ssh

Sig*_*ggi 11 git ssh-keys git-commit

尝试在我的 Debian 机器上设置 git commit 签名。我已经在我的 Windows 盒子上安装了这个设置,并且运行良好。我的 Debian 盒子上没有那么多。当我尝试提交时出现以下错误:

siggib@htzn:/var/www/phpdemo$ git commit -m "tweak"
error: unsupported value for gpg.format: ssh
fatal: bad config variable 'gpg.format' in file '/home/siggib/.gitconfig' at line 6
Run Code Online (Sandbox Code Playgroud)

这是我的配置的样子

siggib@htzn:/var/www/phpdemo$ git config --list
user.name=siggib@htzn
user.email=siggib007@users.noreply.github.com
user.signingkey=ssh-ed25519 AAAAC3NzaC.....
gpg.format=ssh
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
remote.origin.url=https://github.com/siggib007/phptest.git
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
branch.master.remote=origin
branch.master.merge=refs/heads/master
siggib@htzn:/var/www/phpdemo$ 
Run Code Online (Sandbox Code Playgroud)

我尝试用谷歌搜索这个,但没有发现任何有用的东西,也尝试在这里搜索,得到相同的结果。有人对我有什么好的指点吗?

Mar*_*oma 31

SSH 签名仅适用于git>=2.34( changelog )。您可能有旧版本。

你可以这样检查:

$ git --version
git version 2.25.1
Run Code Online (Sandbox Code Playgroud)

更新git

如果您使用的是 Ubuntu,您可以获得如下所示的更新版本:

$ sudo add-apt-repository ppa:git-core/ppa -y
$ sudo apt-get update
$ sudo apt-get upgrade
Run Code Online (Sandbox Code Playgroud)


Sig*_*ggi 8

结果 Debian 11 中的默认 git 版本不提供 SSH 签名。必须按照此/sf/answers/5217025621/安装更新的 git 版本。