Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which is the file format of ~/.gitconfig?

I would like to format my ~/.gitconfig file, but I don't know the file type. Is it toml or yml or something else?

Do indentations matter? What structure does it expect?

like image 339
Eliaz Bobadilla Avatar asked Sep 04 '25 01:09

Eliaz Bobadilla


2 Answers

Which is the file format of ~/.gitconfig?

The format is described in documentation. It has no specific "standard" format. It's just a format that Git expects. It is similar to an ini file, but not quite - there are subsections and values with quotations.

what tool I could use able to format the text of the file

Just do not indent sections and comments and indent any other lines. You can write such a program in sed or awk.

like image 85
KamilCuk Avatar answered Sep 07 '25 09:09

KamilCuk


follow by wiki: https://en.wikipedia.org/wiki/INI_file#cite_note-4 and official doc: https://git-scm.com/docs/git-config#_configuration_file

it is really totally ini file, u can use ini format it.

like image 39
defend orca Avatar answered Sep 07 '25 09:09

defend orca