Can I comment out a line in a .git/config file?

GitConfig

Git Problem Overview


I have a http.proxy line on my repository configuration file that I would like to 'turn on and off' easily without having to remember and type again the whole configuration every time I'm behind or free from this proxied connection.

Another possibility would be to use this repository configuration file when I'm behind the proxy and when not, use a global/local configuration file without any proxy setup.

Git Solutions


Solution 1 - Git

Yes, you can comment lines out of Git config files using # or ;.

From the documentation:

> Syntax > > The syntax is fairly flexible and permissive; whitespaces are mostly ignored. The # and ; characters begin comments to the end of line, blank lines are ignored.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
Questionn370View Question on Stackoverflow
Solution 1 - GitChrisView Answer on Stackoverflow