How do I display the global configuration Git?

This translation from: How do the I Show My, Ltd. Free Join the Configuration Git?

I'd like to show all configured Git sections. I want to show all Git part of the configuration.

Only found the I git config --get core.editor, and the I'd like to the Output Everything that's the Configured Globally, not only the Configured default at The Editor. I only found git config --get core.editor, I think all the contents of the global output configuration, not just the default configuration editor.


#1st Floor

Reference: How https://stackoom.com/question/pPqO/ show my global configuration Git


#2nd Floor

CAN use by You git config --list, or your look AT ~/.gitconfigFile. You can use git config --list, or view the ~/.gitconfigfile. By Will BE in your config Local Repository's .git/configFile. Local Configuration store will be located in the library .git/configfile.


#3rd floor

git config --list

It is one way to go. is one way. Usually the Just Open up the I .gitconfigthough. I usually just open .gitconfig.


#4th floor

The shortest, shortest,

git config -l

shows all inherited values from: system, global and local display of all inherited values: system, global and local


#5th Floor

You can also use cat ~/.gitconfig.


#6th floor

2.6 git (Sept / On Oct, 2015) The Option Will the Add --name-onlyto Simplify The Output of A git config -l: git 2.6 (, 2015 September / October October) adding the option --name-onlyto simplify git config -loutput:

See the commit a92330d , the commit f225987 , the commit 9f1429d (20 Aug 2015) by Jeff King ( peff) . See Jeff King ( peff) the submission a92330d , submit f225987 , submit 9f1429d (2015 Nian 8 Yue 20 Ri ) .
See the commit ebca2d4 (20 Aug 2015), and the commit 905f203 , the commit 578625f (10 Aug 2015) by SZEDER Gábor ( szeder) . Refer to submit ebca2d4 (2015 Nian 8 20 June) by SZEDERGábor ( szeder) submit 905f203 , submit 578625f ( August 10, 2015) .
(Merged by Junio C Hamano - gitster- in the commit fc9dfda , 31 Aug 2015) (a Junio Cgitster merger - gitster- in the commit fc9dfda , 2015 Nian 8 31 Mar)

config: The Add ' --name-only' to the Option List variable names only config: add ' --name-only' option lists only the variable name

' git config' Show only CAN values or name-value pairs, SO IF A Needs The names of the shell Script Variables config IT SET has to RUN ' git config --list' or ' --get-regexp' and to separate the parse config The Output Their values from variable names. ' git config' Only display value or name - value pairs, if needed shell script variable names set config, it must be run ' git config --list' or ' --get-regexp' and outputs it to parse the configuration variable name and its value.
However, such a parsing can not cope with multi-line values. However, this resolution can not handle multi-line value.

Though ' git config' CAN Produce null-terminated Output for NEWLINE-Safe parsing, that apos of NO use in SUCH A Case, Because shells CAN Not COPE with null characters. While the ' git config' may wrap the safety parsing generates a null-terminated outputs, but in this case there is no use, because the shell can not handle the null character.

Even our own bash completion script suffers from these issues. Even our own bash completion script will encounter these problems.

Completion Script at The Help, and shell scripts in General, by Introducing at The ' --name-only' to the Modify the Option of the Output at The ' --list' and ' --get-regexp' only to List config at The names of the Variables, SO They do not have have to the perform error-prone to POST Processing separate variable names from their values anymore. in general, by introducing ' --name-only' to modify the options ' --list' and ' --get-regexp' output to list only the name of the configuration variables to help complete scripts and shell scripts, so they do not have to perform the error-prone to deal with the variable name and its value.

Original articles published 0 · won praise 73 · views 550 000 +

Guess you like

Origin blog.csdn.net/w36680130/article/details/105339665