When I work inside a Dev Container opened with anysphere.remote-containers v1.0.17, every git commit (invoked via Cursor’s Source Control UI) fails:
git -c user.useConfigOnly=true commit --quiet --allow-empty-message --file -
fatal: cannot exec ‘/opt/homebrew/bin/gpg’: No such file or directory
error: gpg failed to sign the data:
(no gpg output)
fatal: failed to write commit object
The container inherits my global ~/.gitconfig, which specifies a host-only GPG path (/opt/homebrew/bin/gpg). Because that binary is absent inside the container, Git aborts and Cursor cannot create commits.
Steps to Reproduce
On macOS host, ensure global GPG-signed commits are enabled (see .gitconfig excerpt below).
Open any project in a Dev Container using anysphere.remote-containers.
In Cursor’s Source Control panel (or terminal), run Commit.
Commit immediately fails with the error shown above.
Expected Behavior
git commit should succeed and be signed with GPG (or fall back gracefully) inside the Dev Container, just as it does on the host.
Operating System
MacOS
Current Cursor Version (Menu → About Cursor → Copy)
This will only affect newly built containers. For existing containers, you’ll need to manually modify the copied .gitconfig.
Alternatively, would it work to use a relative path for gpg, or set the setting git config --global commit.gpgsign false as part of a post-attach initialization script?
Hi @ravirahman, Thank you for your fix. I updated the dev container to version 1.0.22 and rebuilt the container without caching. I checked the .gitconfig file and indeed there is no “gpg” section now. However, I still cannot commit the signed commit. The output is as follows:
git -c user.useConfigOnly=true commit --quiet --allow-empty-message --file -
error: gpg failed to sign the data:
gpg: skipped “215C21B10DF38B4D”: No secret key
[GNUPG:] INV_SGNR 9 215C21B10DF38B4D
[GNUPG:] FAILURE sign 17
gpg: signing failed: No secret key