This is a small CLI helper for git submodule based monorepos.
A small collection of helpful git commands to use with geilorepo exec.
All examples should be run in the projects root directory.
Create a patch of your local, uncommited changes for a specific path / files:
cd test-environment/modules/test-module-1
git diff origin/main -- pom.xml > /tmp/example.patchCreate a patch of the diff between your local git HEAD and origin/main:
cd test-environment/modules/test-module-1
git diff HEAD origin/main -- pom.xml > /tmp/example.patchCreate a patch of the diff between commit X and origin/main:
cd test-environment/modules/test-module-1
git diff e9aa09d5 origin/main -- pom.xml > /tmp/example.patchCreate a patch of the diff between commit X and Y:
cd test-environment/modules/test-module-1
git diff e9aa09d5 c991fec5 -- pom.xml > /tmp/example.patchThen, apply the patch:
cd test-environment/
geilorepo exec --include-tags pom 'git apply /tmp/example.patch'Maybe, it all goes to shit and you have to wiggle it
cd test-environment/
geilorepo exec --include-tags pom 'git apply /tmp/example.patch || wiggle --replace pom.xml pom.xml.rej'