'couldn't commit to Github remotely

I have been trying to create a repository from VScode but couldn't therefore I had to follow Github's default way of creating and pushing commits manually. The error it throws-:

git -c user.useConfigOnly=true commit --quiet --allow-empty-message --file - -S
gpg: skipped "digambernegi <digambernegi001.com>": No secret key   
gpg: signing failed: No secret key
error: gpg failed to sign the data
fatal: failed to write commit object

Git Log

[2022-05-01T07:41:58.034Z] > git config --get-all user.name [104ms]
[2022-05-01T07:41:58.144Z] > git config --get-all user.email [104ms]
[2022-05-01T07:42:03.415Z] > git ls-files --stage -- 
C:\Users\Nagi\Downloads\multinavbar\index.html [128ms]
[2022-05-01T07:42:03.667Z] > git cat-file -s a8491a2abe471cef2354da09d005227a8725f831 [210ms]
[2022-05-01T07:42:06.503Z] > git ls-files --stage -- 
C:\Users\Nagi\Downloads\multinavbar\index.html [106ms]
[2022-05-01T07:42:06.631Z] > git cat-file -s a8491a2abe471cef2354da09d005227a8725f831 [120ms]
[2022-05-01T07:42:08.633Z] > git -c user.useConfigOnly=true commit --quiet --allow-empty- 
message --file - -S [282ms]
[2022-05-01T07:42:08.633Z] gpg: skipped "digambernegi <digambernegi001.com>": No secret key
gpg: signing failed: No secret key
error: gpg failed to sign the data
fatal: failed to write commit object

What I want to achieve is I can easily create a repository and push it to Github from vsCode only and commit all other later changes.



Solution 1:[1]

You need to check first if you need commit signing.

If not, check if you have git config --global commit.gpgsign set to true, because that would explain why VSCode is trying to sign your commit.

Setting it to false would allow you to test if VSCode can get past this stage, and create your commit in your new local repository.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 VonC