Reputation: 666
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?
Upvotes: 29
Views: 12853
Reputation: 743
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.
Upvotes: 4
Reputation: 140970
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
.
Upvotes: 22