mantisbt:git_submodules
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
mantisbt:git_submodules [2014/04/30 11:55] – Formatting 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 127: | 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 134: | Line 140: | ||
cd / | cd / | ||
git fetch upstream | git fetch upstream | ||
+ | </ | ||
+ | * Optional: update the //master// branch < | ||
+ | git rebase upstream/ | ||
</ | </ | ||
* Update the branch < | * Update the branch < | ||
Line 141: | Line 150: | ||
* Resolve any conflicts | * Resolve any conflicts | ||
* Push changes to the fork < | * Push changes to the fork < | ||
- | git push origin | + | git push origin |
- | </ | + | </ |
- Update the submodule | - Update the submodule | ||
* Go to your local mantisbt repository and update it< | * Go to your local mantisbt repository and update it< | ||
Line 155: | Line 164: | ||
cd .. | cd .. | ||
</ | </ | ||
- | - Update | + | - Update |
- Commit the changes < | - Commit the changes < | ||
git commit -a | git commit -a | ||
</ | </ | ||
+ | |||
+ | At this point, checking the submodules' | ||
+ | |||
+ | < | ||
+ | $ git submodule | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | </ | ||
+ | |||
+ | ==== 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.1398873312.txt.gz · Last modified: 2014/04/30 11:58 (external edit)