Help with git config #1140
-
Hi there, Maybe it is a newbie question, but is there any method on GitPython that retrieves the configuration at levels system, global and local easily? Could you help me, please? Thanks in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
What should work is to explicitly ask for a ConfigReader at from an existing git repository instance, like so: I hope that helps. Please note that I am closing this issue, yet you are free to keep posting here for follow-up questions or comments. |
Beta Was this translation helpful? Give feedback.
What should work is to explicitly ask for a ConfigReader at from an existing git repository instance, like so:
r = git.Repo(path).config_reader()
. When that instance is asked for a value like sor.get_value('user', 'name')
it would find the respective value in any of the layered configuration files, looking first in the repository configuration, then user, and then the system.I hope that helps. Please note that I am closing this issue, yet you are free to keep posting here for follow-up questions or comments.