Hi,

I am experiencing a problem with git submodules:
git cannot update submodules from remote when using a non-master branch and 
shallow clones.

Tested git versions

client: 2.13 (Windows)
server: 2.10 (CentOS 7)

Behaviour

when I have a submodule that is configured to get updates from a non-master 
branch and, at the same time, shallow clones are enabled, "git submodule update 
--remote" fails.

Example configuration in .gitmodules:

[submodule "webapi"]
               path = webapi
               url = ../../api/web-api.git
               branch = release/2.1
               shallow = true
               
The error message is:

fatal: Needed a single revision
Unable to find current origin/release/2.1 revision in submodule path 'webapi'

I think that the cause of this problem is the following:
When this submodule is initialised initially, in ".git/modules/webapi/config" I 
can see that fetch is configured this way:

fetch = +refs/heads/master:refs/remotes/origin/master

That's probably why git cannot find my release/2.1 branch. The question is - 
why this happens despite the submodule is explicitly configured to use a 
non-master branch in .gitmodules?... 

NB 
For the remote git, I enabled both uploadpack.allowReachableSHA1InWant & 
uploadpack.allowTipSHA1InWant.

Kind regards,
Maxim


This e-mail and any attachment(s), is confidential and may be legally 
privileged. It is intended solely for the addressee. If you are not the 
addressee, dissemination, copying or use of this e-mail or any of its content 
is prohibited and may be unlawful. If you are not the intended recipient please 
inform the sender immediately and destroy the e-mail, any attachment(s) and any 
copies. All liability for viruses is excluded to the fullest extent permitted 
by law. It is your responsibility to scan or otherwise check this email and any 
attachment(s). Unless otherwise stated (i) views expressed in this message are 
those of the individual sender (ii) no contract may be construed by this 
e-mail. Emails may be monitored and you are taken to consent to this monitoring.
Civica Pty Limited  ABN 83 003 691 718    Incorporated in New South Wales

Reply via email to