261

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.

1 Answer 1

347

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.

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.