User Tools

  • Logged in as: anonymous (anonymous)
  • Log Out

Site Tools


mantisbt:git_submodules

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
mantisbt:git_submodules [2014/04/30 12:27]
dregad Update master branch from upstream, push tags and note
mantisbt:git_submodules [2014/04/30 13:00] (current)
dregad Added update from within the submodule (phpmailer example)
Line 120: Line 120:
 Submodule path '​library/​adodb':​ checked out '<​commit sha>'​ Submodule path '​library/​adodb':​ checked out '<​commit sha>'​
 </​code>​ </​code>​
 +
  
  
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 ​given here are for the ADOdb library, but the same logic should apply (possibly with some variations) to other submodules as well.+==== Updating via an external repository ==== 
 + 
 +The example ​given here are for the ADOdb library, but the same logic should apply (possibly with some variations) to other submodules as well.
 We assume that you already have a local repository configured with the appropriate remotes (//​upstream//​ for the library'​s official repository and //origin// for the MantisBT fork) We assume that you already have a local repository configured with the appropriate remotes (//​upstream//​ for the library'​s official repository and //origin// for the MantisBT fork)
  
Line 161: Line 164:
 cd .. cd ..
 </​code>​ </​code>​
-  - Update ​readme.libs to reflect the new version+  - Update ​''​README.libs'' ​to reflect the new version
   - Commit the changes <​code>​   - Commit the changes <​code>​
 git commit -a git commit -a
Line 175: Line 178:
  ​41beaddd279c695aacb63407e2c98b04b7eaff51 securimage (heads/​mantis)  ​41beaddd279c695aacb63407e2c98b04b7eaff51 securimage (heads/​mantis)
 </​code>​ </​code>​
 +
 +==== 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**:​ if you update the submodule in-place, it is critical that you actually push the changes to //origin// otherwise the other developers will have an corrupted repository with missing commits when they pull the changes.
 +
 +  * Update the submodule from upstream <​code>​
 +cd library/​phpmailer
 +git fetch upstream
 +git rebase upstream/​master master
 +git checkout mantis
 +git merge v5.2.7
 +# Resolve conflicts
 +</​code>​
 +  * Push changes to the fork - **don'​t forget this step !**<​code>​
 +git push origin --tags master mantis
 +cd ..
 +</​code>​
 +  * Edit ''​README.libs''​
 +  * Commit the changes <​code>​
 +git commit -a
 +</​code>​
 +
  
mantisbt/git_submodules.1398875259.txt.gz · Last modified: 2014/04/30 13:00 (external edit)