Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is [---] a comment in .gitconfig?

Tags:

git

comments

This question is based on this thread.

Is [---] a comment in Git such that I can use only % tool=opendiff % once in my .gitconfig?

like image 903
Léo Léopold Hertz 준영 Avatar asked Jul 04 '09 00:07

Léo Léopold Hertz 준영


People also ask

What is Gitconfig file?

The git config command is a convenience function that is used to set Git configuration values on a global or local project level. These configuration levels correspond to . gitconfig text files. Executing git config will modify a configuration text file.

Why is there no Gitconfig file?

The reason they can't find gitconfig is simply because it's nowhere to be found. When developers install Git, the various Git configuration files won't automatically create. Files like gitconfig and . gitconfig are only created when they're first used.

Can I delete .gitconfig file?

gitconfig in unix platform. In Windows it will be stored in C:/users/<NAME>/. gitconfig. You can edit it manually by opening this files and deleting the fields which you are interested.


1 Answers

I think you are asking whether the square bracket syntax in .gitconfig means something significant. The answer is yes, it separates .gitconfig into sections. Each section has a name, shown between the square brackets. For example:

[core]
        repositoryformatversion = 0
        filemode = true
        bare = false

In the above example, the section name is core. If you change the word core to something else, Git won't be able to find, for example, the bare option because it needs to be inside the core section.

The git-config(1) manual page has a whole section describing the format of the configuration file.

like image 92
Greg Hewgill Avatar answered Oct 15 '22 08:10

Greg Hewgill