Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot commit file change when git.enableCommitSigning=true "Git: fatal: cannot run gpg: No such file or directory" #40687

Closed
leizongmin opened this issue Dec 22, 2017 · 5 comments
Assignees
Labels
git GIT issues

Comments

@leizongmin
Copy link

  • VSCode Version: Code 1.19.1 (0759f77, 2017-12-19T09:35:14.671Z)
  • OS Version: Darwin x64 17.3.0
  • Extensions:
Extension Author (truncated) Version
language-x86-64-assembly 13x 2.2.11
vscode-markdownlint Dav 0.12.0
better-toml bun 0.3.1
vscode-weapp-api cod 0.1.8
vscode-wxml cod 0.1.9
vscode-eslint dba 1.4.3
gitlens eam 7.0.0
tslint eg2 1.0.24
vscode-great-icons emm 2.1.22
prettier-vscode esb 1.0.1
code-runner for 0.8.5
vscode-rust kal 0.4.2
luaide kan 0.5.5
node-module-intellisense lei 1.5.0
vscode-json5 mrm 1.0.0
view-in-browser qin 0.0.5
vscode-coverage-gutters rya 1.3.0
vscode-java-debug vsc 0.5.0
vscode-java-pack vsc 0.2.0
vscode-todo-highlight way 0.5.11
vscode-proto3 zxh 0.1.2

(3 theme extensions excluded)


Steps to Reproduce:

  1. change settings: "git.enableCommitSigning": true
  2. open a git project, make some change
  3. switch to Git on the activity bar
  4. enter some commit message, click commit change

it shows the following error message: Git: fatal: cannot run gpg: No such file or directory

the output panel shows:

git commit --quiet --allow-empty-message --file - -S
fatal: cannot run gpg: No such file or directory
error: gpg failed to sign the data
fatal: failed to write commit object

I pretty sure gpg is already installed on my system, here is gpg --version command outputs:

gpg (GnuPG/MacGPG2) 2.2.3
libgcrypt 1.8.1
Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

and the which gpg outputs: /usr/local/bin/gpg

Reproduces without extensions: Yes

@vscodebot vscodebot bot added the git GIT issues label Dec 22, 2017
@joaomoreno
Copy link
Member

If you open the Developer Tools, in the Console, what does process.env.PATH return?

@lbennett-stacki
Copy link

I'm also experiencing this.

which gpg returns /usr/local/bin

process.env.PATH returns a valid PATH string that contains /usr/local/bin.

@lbennett-stacki
Copy link

I found and followed the advice of https://stackoverflow.com/questions/36941533/git-hub-desktop-on-mac-error-cannot-run-gpg-no-such-file-or-directory

Running git config --global gpg.program $(which gpg) seems to fix it for me.

@leizongmin
Copy link
Author

@joaomoreno process.env.PATH is /Users/glen/.cargo/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands

@leizongmin
Copy link
Author

@LukeeeeBennett as per your advice, it works well, thanks 👍

@vscodebot vscodebot bot locked and limited conversation to collaborators Feb 22, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
git GIT issues
Projects
None yet
Development

No branches or pull requests

3 participants