1

Using gitpython, I would like to use repo.git.submodule('foreach', …) and get the variables available such as name, sm_path, displaypath, sha1 and toplevel as defined in the git documentation.

I couldn't find any documentation on gitpython and my understanding of the API is limited.

1

1 Answer 1

1

Thanks to stsewd reply on Github issue, one should write

repo = git.Repo('foo/bar')
for sub in repo.submodules:
    pass

and the documentation: https://gitpython.readthedocs.io/en/stable/reference.html#git.repo.base.Repo.submodules

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.