我遇到了一个奇怪的问题,找了很长一段时间,没有找到解决办法。
我有一个名为lapp-yhkt
(本地路径:/g/webstorm/lapp-yhkt
)的主要项目:
以及.gitmodules
的内容:
在这个目录下,我从Git-Tools-Submodules执行步骤
第一个init子模块,
$ git submodule init
Submodule 'app/base' (https://git.mobcb.com/liteapp/lapp-base.git) registered for path 'app/base'
更新它并得到致命错误,
$ git submodule update
Cloning into 'G:/webstorm/lapp-yhkt/app/base'...
bash: /dev/tty: No such device or address
error: failed to execute prompt script (exit code 1)
fatal: could not read Username for 'https://git.mobcb.com': Invalid argument
fatal: clone of 'https://git.mobcb.com/liteapp/lapp-base.git' into submodule path 'G:/webstorm/lapp-yhkt/app/base' failed
在此之后,我还尝试了git submodule sync
和git submodule update
$ git submodule sync
Synchronizing submodule url for 'app/base'
$ git submodule update
Cloning into 'G:/webstorm/lapp-yhkt/app/base'...
bash: /dev/tty: No such device or address
error: failed to execute prompt script (exit code 1)
fatal: could not read Username for 'https://git.mobcb.com': Invalid argument
fatal: clone of 'https://git.mobcb.com/liteapp/lapp-base.git' into submodule path 'G:/webstorm/lapp-yhkt/app/base' failed
但同样的错误也发生在我身上,我很沮丧。希望有人能提前救我,谢谢你。
编辑:--我在windows中使用了git。
发布于 2017-06-20 07:13:36
解决方案:
当一个人使用HTTPS URL克隆,然后尝试使用Git Bash在Windows上使用以下方法推动更改时,就会出现此问题:
git clone https://github.com/{username}/{repo}.git
但是,如果使用SSH URL进行克隆,则不会出现此问题:
git clone git@github.com:{username}/{repo}.git
https://stackoverflow.com/questions/44646045
复制相似问题