git-secret warning: at least one key for email(s) is revoked, expired, or otherwise invalid

Lee young-jun
3 min readDec 1, 2023

--

I tried to update the data of my app in a long time.
However I met this error when I tried to encrypt the data file before pushing.

git secret hide

I checked my git config, but there is no problem.

GPG Key List

Therefore I googled and found out the solution.
First, I checked if my key is expired.

gpg — list-secret-keys

Renew GPG Key

And I started extending gpg key. To extend the key, I should open key editing mode with key id(F3E91404A7D5E4D982F1DE3CD3A023D18437FF5F).

gpg — edit-key {key id}

Last, I expired current key with a command.

expire

Then the prompt asked me how much longer keep the key. In this case, I extend the key 50 years.

And I could see expires updated.

To apply the expiration changing to the key, I saved it.

save

Select Public Key

Even if I updated the key, I got same error still. I found the warning for second key(ssb)

To extend public key also, select the sub key like this.

key 1

Then I could saw start at ssb. This means ssb is selected. Run the command again if you want to unselect it.

And I expired it too.

Remove person

There is no expired key, But I got the error still. What’s the problem?

I googled again and found a solution.

The solution is removing the person and tell again

git secret removeperson toyboy2@hanmail.net

and I confirmed it with this command.

git secret whoknows

Accoding to the message, I ran the command and the error is disappeared.

git secret tell {email}

References

--

--

No responses yet