linuxinigit-config

How to edit /etc/krb5.conf from cli with the "git config" command?


I'm trying to edit /etc/krb5.conf with the git config command according to this example.

I tried this :

$ git config --file=/etc/krb5.conf libdefaults.renew_lifetime 7d
error: invalid key: libdefaults.renew_lifetime
$ echo $?
1
$

I expect this :

$ git config --file=/etc/krb5.conf libdefaults.renew_lifetime 7d
$ git config --file=/etc/krb5.conf libdefaults.renew_lifetime
7d
$

Solution

  • Git doesn't allow you to have underscores in your config keys. This behavior is coded here https://github.com/git/git/blob/master/config.c#L586

    $ git config --file=/etc/krb5.conf libdefaults.renewlifetime # note no "_"
    

    will produce:

    [libdefaults]
        renewlifetime = 7d