I have a repo initialized as
r = git.Repo.init(dirPath)
How can I get the user.email field for the git config for that repo using gitpython?
I have a repo initialized as
r = git.Repo.init(dirPath)
How can I get the user.email field for the git config for that repo using gitpython?
After looking into the source of gitpython this is one way I managed to do it.
r = git.Repo.init(dirPath)
reader = r.config_reader()
field = reader.get_value("user","email")
Repo
object? Like getting global settings. –
Afflictive git.config.GitConfigParser().get_value(...)
(see github.com/gitpython-developers/GitPython/pull/950) –
Anabaptist © 2022 - 2024 — McMap. All rights reserved.