Update Git Submodule Pointer
From TYPO3Wiki
Update Git submodule reference
This walkthrough requires basic knowledge of Git and the command line.
If you are not familiar with the command line, please refer to the overview of other Contribution Walkthrough tutorials. An Introduction to Git is available for Git beginners.
Submodules
Several external projects are included as submodules into the TYPO3 Core (dbal, workspaces, version). After a change in a submodule was merged with the official TYPO3 Git repository, the super project (TYPO3 Core) needs to be updated as well. Each submodule defines an accordant pointer to a commit SHA1 in the Core, thus a specific state of the submodule is linked in the Core.
Update the reference
In this example the submodule reference of DBAL is updated.
- Ensure that you have a clean local Git repository
- Change to the accordant submodule directory (typo3/sysext/dbal in this case)
cd typo3/sysext/dbal/
- Pull the changes from the DBAL Git repository
git pullremote: Counting objects: 12, done. remote: Compressing objects: 100% (7/7), done. remote: Total 7 (delta 6), reused 0 (delta 0) Unpacking objects: 100% (7/7), done. From git://git.typo3.org/TYPO3v4/Extensions/dbal 238567b..4727a2f DBAL_1-2 -> origin/DBAL_1-2 96b4ce9..2329d5a master -> origin/master First, rewinding head to replay your work on top of it... Fast-forwarded master to 2329d5ace7fbcbc81759b62abe052a189f810f47.
- Change to the root directory of the local Git repository again and show the differences of the updated commit SHA1 of the submodule
cd ../../../ git diff
diff --git a/typo3/sysext/dbal b/typo3/sysext/dbal index 96b4ce9..2329d5a 160000 --- a/typo3/sysext/dbal +++ b/typo3/sysext/dbal @@ -1 +1 @@ -Subproject commit 96b4ce91b0c2645a498ed586a1c3630db4467462 +Subproject commit 2329d5ace7fbcbc81759b62abe052a189f810f47
- Add the changes to the index (important: there is no slash at the end of the submodule)
git add typo3/sysext/dbal
- Commit the change
git commit- Enter accordant commit message
[TASK] Raise submodule reference Resolves: #<ISSUE>
- Push the changes as regular
git push origin HEAD:refs/for/<BRANCH>