File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4646 for files in the directory ``Core/MyModule/MySubmodule/`` and your current working directory is ``Core/MyModule/``.
4747 The correct command would be:
4848
49- ``git apply --verbose --directory='Core/MyModule/MySubModule ' MySubmodule.patch``
49+ ``git apply --verbose --directory='Core/MyModule/MySubmodule ' MySubmodule.patch``
5050
5151Updating the patch
5252======================
5353If you have further changes to a project with a patch, you can update the patch by first reversing the patch, using the
54- ``--apply`` and ''--directory`` arguments as shown above. To reverse the patch you also require the ``-R``. This will
55- return the project to the state before the patch was applied. If you commit this base project, then re-apply the patch
56- and any additional changes, you can generate a new patch with the latest state.
54+ ``--apply`` and ``--directory`` arguments as shown above. To reverse the patch you also require the ``-R``. This will
55+ return the project to the state before the patch was applied. You can then stage the project and re-apply the patch to
56+ the project to have the patch
57+
58+ .. code-block:: sh
59+
60+ # First apply the reverse patch
61+ git apply --verbose --directory='some-project' -R some-project.patch
62+
63+ # Stage the project in its unpatched state
64+ git add some-project
65+
66+ # Re-apply the patch
67+ git apply --verbose --directory='some-project' some-project.patch
68+
69+ Now you can make further changes to the project, and re-generate the patch using the raw git command as shown above.
70+
71+ .. code-block:: sh
72+
73+ # Generate the patch from the directory again
74+ cd some-project
75+ git diff --relative --binary --no-ext-diff --no-color . > ../some-project.patch
76+
77+ # Force a fetch and update the patch to test your changes
78+ dfetch update -f some-project
5779
5880"""
5981
You can’t perform that action at this time.
0 commit comments