Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get the user.email config using gitpython ?

Tags:

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?

like image 728
Hakan Baba Avatar asked Mar 01 '17 17:03

Hakan Baba


1 Answers

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")
like image 130
Hakan Baba Avatar answered Oct 02 '22 15:10

Hakan Baba