{"thread":{"id":"54920","subject":"Expected behaviour of 'git submodule update --remote --recursive'?","startedAt":"2021-01-02T17:47:04Z","lastAt":"2021-01-02T17:47:04Z","messageCount":1,"participants":["Andy Wharton"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"413314","messageId":"CANUvzQ12V1ptr9uEpXFnJQWcWgjs4+vTjgaXTMrsJ6foAMpv2Q@mail.gmail.com","threadId":"54920","inReplyTo":null,"subject":"Expected behaviour of 'git submodule update --remote --recursive'?","fromName":"Andy Wharton","fromEmail":"awharton1976@gmail.com","sentAt":"2021-01-02T17:45:55Z","receivedAt":"2021-01-02T17:47:04Z","isPatch":false,"sender":{"key":"awharton1976@gmail.com","avatar":null},"body":"Hi all,\n\nI have three git repo's:\n    A imports B as a submodule, and has \"branch = .\" set for B in .gitmodules\n    B imports C as a submodule, and has \"branch = .\" set for C in .gitmodules\n\nI had hoped that checking out a branch in A, and then running 'git\nsubmodule update --remote --recursive' in A would checkout the latest\ncommit from that branch in the two submodules.\n\nThis works as expected for B (checks out the right SHA as a deteched\nhead), but because I'm left on a detached head the update fails for C\nwith a \"branch configured to inherit branch from superproject\"\nmessage.\n\nWhile I'm guessing this is the expected behaviour, is it possible to\nmake the \"branch = .\" option use the branch name from the parent\ntransitively? Or is there another mechanism I should be using to\nachieve what I'm trying to do?\n\nAndy.\n"}]}