I have a repo including two submodules. I want to detect the changes in submodules.
For example, I have a repo called repo1 and there are two submodules in it called sub_repo1 and sub_repo2. I want to detect changes in these two submodules and merge it into repo1. I have tried the following code
from git import Repo
repo = Repo(repo1_path)
for submodule in repo.submodules():
<I cannot find more reference>
I cannot find the reference about how to detect submodule changes.
I can use git diff in these submodules to find the remote changes.
My questions are:
- Can I detect changes in
submodule? - Can I get the listed result rather than a mass of string like
git diffusing GitPython (like a class called )?
Thanks a lot.
The reference I have checked are: