Which is the file format of ~/.gitconfig?

Viewed 2466

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?

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.

Related