Hi,
I am adding the mailing to this conversation so people can learn from it.
I am having to learn a little about submodules as well and am slowly getting used to it.
There are a few things to remember
- The submodules are cloned as read-only so that anyone can clone the main repository
- When a submodule is checked out it is in detached head state which means it is not on a branch.
As I see it there are 2 ways of working on a submodule.
- Checkout the submodule as read-only in a separate folder and work on it there and commit using that branch
- Each time you want to edit a submodule make it read-write, make and push change, make it read-only again.
Here are the steps for the two methods:
=== Separate clone of submodule ===
(not tested)
Note this example only shows how to do the work on one branch so if you want the commit on 2.8.x as well you have to cherry-pick the commit to that branch and update the references on core-geonetwork 2.8.x branch as well.
- edit submodule
- commit and push submodule
- switch to core-geonetwork
- git submodule update
- git status (if it works as expected it should show that the submodule has changed)
- git add
- git commit -m “updated submodule reference to contain commit with the bug fix …”
- git push
=== Edit submodule in place ===
(tested)
- edit .gitmodules (change git://github.com/ to git@anonymised.com
- git sync
- git update
- cd submodule
- git checkout master (or 2.8.x)
- make changes and commit
- git checkout 2.8.x
- (if you want the change on 2.8.x as well)1. git log master
- find commit you want to merge to 2.8.x1. git cherry-pick
- git push
- (will push changes to both 2.8.x and master)1. cd …
- (back to core)1. git checkout 2.8.x
- (submodule is on 2.8.x now so you need to update 2.8.x reference)1. git add
- git commit -m “updated submodule reference to contain commit with the bug fix …”
- git checkout master
- cd submodule
- git checkout master
- cd …
- git add
- git commit -m “updated submodule reference to contain commit with the bug fix …”
- git co – .gitmodules (revert .gitmodules to read-only urls again)
- git submodule sync
- git submodule update
I will try to make some video tutorials for these workflows when I have time. I will also try out some of the tools.
Jesse
On Tue, Jun 19, 2012 at 9:55 PM, Jose Garcia <jose.garcia@anonymised.com> wrote:
Hi Jesse
Trying to commit in docs submodule I get this:
Pushing to git://github.com/geonetwork/core-doc-sources.git
fatal: remote error:
You can’t push to git://github.com/geonetwork/core-doc-sources.git
Use git@anonymised.com.:geonetwork/core-doc-sources.git
Any idea? I tried with 2 different Git apps and same error.
Thanks and regards,
Jose García
–
GeoCat Bridge for ArcGIS allows instant publishing of data and metadata on GeoServer and GeoNetwork. Visit http://geocat.net for details.
Jose García
GeoCat bv
Veenderweg 13
6721 WD Bennekom
The Netherlands
http://GeoCat.net