Scenario: migrate code from one git repo to the other that do not have a common folder structure.
For example a single TYPO3 extension within two different projects:
- From: typo3conf/ext/my_ext
- To: packages/my_ext
https://git-scm.com/docs/git-format-patch https://git-scm.com/docs/git-am
git format-patch -2 1ab8c73f35703318070ff51fbd7320b9b1fd901c .
> 0001-Commit-message-123.patch
> 0002-Commit-message-321.patch
cat 0001-Commit-message.patch
From 7ae37629db6ec0745fc7ffaf6ffd704f1f9bf206 Mon Sep 17 00:00:00 2001
From: Bob Ross <[email protected]>
Date: Mon, 18 Nov 2019 12:01:54 +0100
Subject: Commit message 123
---
.../ext/my_ext/Configuration/TypoScript/setup.txt | 3 +++
1 file changed, 3 insertions(+)
diff --git a/typo3conf/ext/my_ext/Configuration/TypoScript/setup.txt b/typo3conf/ext/my_ext/Configuration/TypoScript/setup.txt
index 3894b16..ddcddc3 100644
--- a/typo3conf/ext/my_ext/Configuration/TypoScript/setup.txt
+++ b/typo3conf/ext/my_ext/Configuration/TypoScript/setup.txt
@@ -27,6 +27,9 @@ lib.yyy >
page.10.variables.header = TEXT
page.10.variables.header.value = 1
+page.10.variables.footer = TEXT
+page.10.variables.footer.value = xxx
+
lib.xxx = COA
lib.xxx {
--
2.7.4
# --3way -> 3-way-merge
# -p4 -> strip off 4 parts (i.e. a/typo3conf/ext/my_ext)
# --directory -> new path prefix (i.e. packages/my_ext)
# --ignore-space-change (if necessary)
git am --whitespace=nowarn --3way -p4 --directory='packages/my_ext' < 0001-Commit-message-123.patch
# maybe you need to resolve conflicts