Git Error: fatal: bad numeric config value 'falseexit' for 'core.trustctime': invalid unit

Viewed 3222

I am getting this error when using git init command and even for other commands like git clone.

git init
fatal: bad numeric config value 'falseexit' for 'core.trustctime': invalid unit
3 Answers

I just ran the following:

git config --global commit.gpgsign true

core.trustctime must be boolean

With Git 2.31 (Q1 2021), the error message given when a configuration variable that is expected to have a boolean value has been improved.

See commit f276e2a (11 Feb 2021) by Andrew Klotz (KlotzAndrew).
(Merged by Junio C Hamano -- gitster -- in commit 483e09e, 17 Feb 2021)

config: improve error message for boolean config

Signed-off-by: Andrew Klotz

Currently invalid boolean config values return messages about 'bad numeric', which is slightly misleading when the error was due to a boolean value.

We can improve the developer experience by returning a boolean error message when we know the value is neither a bool text or int.

Before with an invalid boolean value of non-boolean, its unclear what numeric is referring to:

fatal: bad numeric config value 'non-boolean' for 'commit.gpgsign': invalid unit

Now the error message mentions non-boolean is a bad boolean value:

fatal: bad boolean config value 'non-boolean' for 'commit.gpgsign'
Related