简体   繁体   English

Git clone-递归使文件不可执行

[英]Git clone --recursive makes file non executable

I have 2 repositories: gs-webui-test-beans and selenium-drivers . 我有2个存储库: gs-webui-test-beansselenium-drivers

selenium-drivers is a submodule in gs-webui-test-beans . selenium-driversgs-webui-test-beans的子模块。

The file chromedriver_linux64_2.1/chromedriver should be executable on Linux after clone. 克隆后,文件chromedriver_linux64_2.1/chromedriver应该可以在Linux上执行。

When I clone selenium-drivers it is indeed executable. 当我克隆selenium-drivers它确实是可执行的。

When I do git clone --recursive on gs-webui-test-beans I check that file again and I see it is not executable. 当我在gs-webui-test-beans上执行git clone --recursive ,我再次检查了该文件,发现它不是可执行文件。

What am I doing wrong? 我究竟做错了什么?

You need to init the submodules. 您需要初始化子模块。 Either do 要么做

git submodule update --init --recursive

after the clone, or specify the --recurse-submodules option for git clone . 在克隆之后,或为git clone指定--recurse-submodules选项。

--recurse-submodules

After the clone is created, initialize all submodules within, using their default settings. 创建克隆后,使用其默认设置初始化其中的所有子模块。 This is equivalent to running git submodule update --init --recursive immediately after the clone is finished. 这等效于克隆完成后立即运行git submodule update --init --recursive This option is ignored if the cloned repository does not have a worktree/checkout (ie if any of --no-checkout / -n , --bare , or --mirror is given) 这个选项被忽略,如果克隆库不具有worktree /结帐(即,如果任何的--no-checkout / -n--bare ,或--mirror给出)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM