mantisbt:git_submodules
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
mantisbt:git_submodules [2014/04/30 12:27] – Update master branch from upstream, push tags and note dregad | mantisbt:git_submodules [2014/04/30 13:00] (current) – Added update from within the submodule (phpmailer example) dregad | ||
---|---|---|---|
Line 120: | Line 120: | ||
Submodule path ' | Submodule path ' | ||
</ | </ | ||
+ | |||
Line 130: | Line 131: | ||
This section describes the process to update a submodule when a new version of a library has been released upstream. | This section describes the process to update a submodule when a new version of a library has been released upstream. | ||
- | The examples | + | ==== Updating via an external repository ==== |
+ | |||
+ | The example | ||
We assume that you already have a local repository configured with the appropriate remotes (// | We assume that you already have a local repository configured with the appropriate remotes (// | ||
Line 161: | Line 164: | ||
cd .. | cd .. | ||
</ | </ | ||
- | - Update | + | - Update |
- Commit the changes < | - Commit the changes < | ||
git commit -a | git commit -a | ||
Line 175: | Line 178: | ||
| | ||
</ | </ | ||
+ | |||
+ | ==== Updating from within the submodule ==== | ||
+ | |||
+ | It's worth mentioning that step 1 above can also be performed straight from the submodule itself (see example below for phpmailer), provided of course that the remotes (origin and upstream) have been properly configured. | ||
+ | |||
+ | **WARNING**: | ||
+ | |||
+ | * Update the submodule from upstream < | ||
+ | cd library/ | ||
+ | git fetch upstream | ||
+ | git rebase upstream/ | ||
+ | git checkout mantis | ||
+ | git merge v5.2.7 | ||
+ | # Resolve conflicts | ||
+ | </ | ||
+ | * Push changes to the fork - **don' | ||
+ | git push origin --tags master mantis | ||
+ | cd .. | ||
+ | </ | ||
+ | * Edit '' | ||
+ | * Commit the changes < | ||
+ | git commit -a | ||
+ | </ | ||
+ | |||
mantisbt/git_submodules.txt · Last modified: 2014/04/30 13:00 by dregad