I have a bitbucket repo where I do all my work. It has a development branch that I branch from to add any features or fix any bugs. When I do a pull request to merge to develop branch I trigger a jenkins build:
The build goes through some steps, and While going through the log I found out that most of the time is wasted doing these 3 git commands:
git submodule sync --recursive
git submodule update --init --recursive --force
git submodule foreach --recursive "git reset --hard HEAD && git clean -xffd"
The submodules in my repo dont change that often, and its the responsibility of other team members, and I dont know when they change anything in them.
Is there away to avoid these 2 commands by checking if the submodules have no changes? is so go to the next submodule and check?
I tried to use "https://stackoverflow.com/a/3278427/7976758" but this works for a main repo, not sure how to write a script that goes in the submodule and run the same script.
Any help is appreciated.