문제

I've always been puzzled by this:

$ git submodule
You need to run this command from the toplevel of the working tree.

Why do I need to run it from the top level directory? Is it a technical reason, or just because of a convention / possible flaw ?

도움이 되었습니까?

해결책

Note: since git 1.8.4 (August 2013), and commit 091a6eb, you don't have to be at top-level to run git submodule update.
This is because git rev-parse has a new --prefix option.

--prefix <arg>

Behave as if git rev-parse was invoked from the <arg> subdirectory of the working tree.
Any relative filenames are resolved as if they are prefixed by <arg> and will be printed in that form.

That same limitation is gone for git submodule add as well.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top