我在Git 2.10发行说明中关于漂亮属性的文章很少.继续将git升级到2.10.0并对全局进行更改,结果如下 -.gitconfig
[filter "lfs"]
clean = git-lfs clean %f
smudge = git-lfs smudge %f
required = true
[user]
name = xyz
email = abc.def@gmail.com
signingkey = AAAAAAA
[core]
excludesfile = /Users/xyz/.gitignore_global
editor = 'subl' --wait
[difftool "sourcetree"]
cmd = opendiff \"$LOCAL\" \"$REMOTE\"
path =
[mergetool "sourcetree"]
cmd = /Applications/SourceTree.app/Contents/Resources/opendiff-w.sh \"$LOCAL\" \"$REMOTE\" -ancestor \"$BASE\" -merge \"$MERGED\"
trustExitCode = true
[alias]
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
[color "diff"]
old …Run Code Online (Sandbox Code Playgroud) 是否有一种简单的方法可以让Git始终标记每个创建的提交或标记?
我尝试过类似的东西:
alias commit = commit -S
但那并没有成功.
我不想安装其他程序来实现这一目标.它可以轻松实现吗?
只是一个侧面的问题,也许不应该提交提交,只有标签,我从不创建,因为我为Homebrew等项目提交单一提交.
我正在尝试使用git命令行在GitHub中创建签名标签.我用(样本)用户名生成了一个GPG密钥Full Name (skytreader) <fullname@gmail.com>.完成后,我尝试创建一个签名标签.但是我收到以下错误:
gpg: skipped "full <fullname@gmail.com>": secret key not available
gpg: signing failed: secret key not available
error: gpg failed to sign the data
error: unable to sign the tag
Run Code Online (Sandbox Code Playgroud)
我想我只需要用指定的用户名创建另一个密钥.但是,输入名称"full",gpg抱怨我的名字至少应该是5个字符.
如何在git中使用此密钥?
我是否更改了git用于使用GPG签署我的标签的用户名,以便获得至少5个字符长的真实姓名?
问题如何在Windows上使用IntelliJ等IDE进行git提交?
如果你有兴趣,请阅读我在这里尝试的内容:
我主要跟随Github的指南.我确保在更改配置文件后不要忘记重启bash/IntelliJ.
.gitconfig是相同的.git config --global commit.gpgsign true(我正在使用git 2.12).我做了一个新的提交并验证它已签名git verify-commit HEAD当我尝试在IntelliJ中提交时,我gpg: cannot open tty 'no tty'发现IntelliT在尝试签名提交(GPG)并添加no-tty到我的C:\Users\username\.gnupg\gpg.conf文件并重新启动时未能提交更改.
然后我得到了gpg: Sorry, no terminal at all requested - can't get input似乎合理的错误,因为我刚添加了与没有终端有关的选项.像gpg:抱歉,没有终端请求 - 无法获得输入说解决方案是删除no-tty我希望不适用于我的情况.
第一个问题中的其他答案建议use-agent在gpg.conf文件中添加,这会导致额外的错误gpg: gpg-agent is not available in this session.等等,也许我需要设置gpg-agent.
我能找到的最佳Windows指南是Archlinux wiki(是的,右).它指定添加到C:/Users/username/.gnupg/gpg-agent.conf …
我无法开始使用Gpg4win.
成功提交.
SashaChernykh@DESKTOP-EEOT0TN D:\SashaGitHub
$ git commit -m "[Test] gpg4win"
gpg: skipped "DBA8E7A2": secret key not available
gpg: signing failed: secret key not available
error: gpg failed to sign the data
fatal: failed to write commit object
Run Code Online (Sandbox Code Playgroud)
我安装了Gpg4win →我在这里设置了Gpg4win ,这个答案是:
SashaChernykh@DESKTOP-EEOT0TN D:\SashaGitHub
$ gpg --list-key
gpg: keyring `C:/Users/SashaChernykh/AppData/Roaming/gnupg/pubring.gpg' created
gpg: C:/Users/SashaChernykh/AppData/Roaming/gnupg/trustdb.gpg: trustdb created
SashaChernykh@DESKTOP-EEOT0TN D:\SashaGitHub
$ gpg --gen-key
gpg (GnuPG) 2.0.30; Copyright (C) 2015 Free Software Foundation, Inc.
This is …Run Code Online (Sandbox Code Playgroud) 设定后
$ gpg --list-keys
/home/pablo/.config/gnupg/pubring.gpg
-------------------------------------
pub rsa4096/46F257F2 2014-09-16 [expires: 2015-09-16]
uid [ultimate] Pablo Olmos de Aguilera Corradini (Personal) <mail@tld.com>
Run Code Online (Sandbox Code Playgroud)
并将信息放在gitconfig上:
[user]
name = Pablo Olmos de Aguilera Corradini
email = mail@tld.com
signinkey = 46F257F2
[commit]
gpgsign = true
Run Code Online (Sandbox Code Playgroud)
我明白了:
gpg: skipped "Pablo Olmos de Aguilera Corradini <mail@tld.com>": No secret key
gpg: signing failed: No secret key
error: gpg failed to sign the data
fatal: failed to write commit object
Run Code Online (Sandbox Code Playgroud)
正如您所看到的那样,键确实存在(它们在运行时也会出现gpg --list-secret-keys).如果我删除了所有内容gitconfig,并尝试仅使用它-S,我得到相同的错误,这让我觉得git将我的用户名和电子邮件传递给gpg,并且uid包含"注释" …
我遵循这个教程:https://help.github.com/articles/signing-commits-using-gpg/
我这样做的时候会尝试签名:https: //github.com/spring-guides/tut-spring-boot-oauth2/commit/824f418ab9d04114b14a90f7c19b4b8d6dda67b7
但是错误:
C:\Users\Administrator\Desktop\foo\test_gpg>git commit -m "test"
gpg: skipped "DABDD34E": secret key not available
gpg: signing failed: secret key not available
error: gpg failed to sign the data
fatal: failed to write commit object
Run Code Online (Sandbox Code Playgroud)
我的配置:
C:\Users\Administrator\Desktop\foo\test_gpg>git config --list --show-origin
file:"C:\\ProgramData/Git/config" core.symlinks=false
file:"C:\\ProgramData/Git/config" core.autocrlf=true
file:"C:\\ProgramData/Git/config" core.fscache=true
file:"C:\\ProgramData/Git/config" color.diff=auto
file:"C:\\ProgramData/Git/config" color.status=auto
file:"C:\\ProgramData/Git/config" color.branch=auto
file:"C:\\ProgramData/Git/config" color.interactive=true
file:"C:\\ProgramData/Git/config" help.format=html
file:"C:\\ProgramData/Git/config" http.sslcainfo=C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt
file:"C:\\ProgramData/Git/config" diff.astextplain.textconv=astextplain
file:"C:\\ProgramData/Git/config" rebase.autosquash=true
file:"C:\\Program Files\\Git\\mingw64/etc/gitconfig" credential.helper=manager
file:C:/Users/Administrator/.gitconfig user.name=donhuvy
file:C:/Users/Administrator/.gitconfig user.email=donhuvy@hotmail.com
file:C:/Users/Administrator/.gitconfig user.signingkey=DABDD34E
file:C:/Users/Administrator/.gitconfig commit.gpgsign=true
file:C:/Users/Administrator/.gitconfig …Run Code Online (Sandbox Code Playgroud) 我的提交目前显示为“未验证”,但应将其设置为“已验证”。
我已按照本指南创建我的 GPG 密钥,当我这样做时,gpg --list-secret-keys --keyid-format LONG我得到以下信息:
sec rsa4096/SOME_KEY 2019-10-24 [SC]
SOME_OTHER_LONGER_KEY
uid [ultimate] Ryan Wood <myemail@address.com>
ssb rsa4096/SOME_OTHER_KEY 2019-10-24 [E]
Run Code Online (Sandbox Code Playgroud)
我按照此处的gpg --armor --export SOME_KEY说明生成了公钥并将其放在 GitHub 上。此外,我按照本指南进行设置,并在上次提交时提示输入密码,我输入正确。我还验证了我提供给 GPG 的电子邮件和我在 GitHub 上列出的电子邮件是相同的。最后,我根据这个问题中提供的答案在 git 中设置我的签名密钥。但是,我的承诺未经验证。git config --global commit.gpgsign truegit config --global user.signingkey SOME_KEY
我还需要在这里做任何其他事情,或者该过程是否需要一定的时间才能显示提交已验证?