gpt4 book ai didi

git - 使用 git 更新子模块时出现 fatal error "could not read Username"

转载 作者:太空狗 更新时间:2023-10-29 14:17:13 25 4
gpt4 key购买 nike

遇到一个奇怪的问题,找了半天没有解决。

我有一个名为lapp-yhkt的主项目(本地路径:/g/webstorm/lapp-yhkt):enter image description here

.gitmodules 的内容:enter image description here

在这个目录中,我执行了来自 Git-Tools-Submodules 的步骤:

第一个初始化子模块,

$ git submodule init
Submodule 'app/base' (https://git.mobcb.com/liteapp/lapp-base.git) registered for path 'app/base'

更新它并得到 fatal error ,

$ 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 syncgit 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。

最佳答案

解决方案:

当使用 HTTPS URL 克隆然后尝试在 Windows 上使用 Git Bash 推送更改时会出现此问题:

git clone https://github.com/{username}/{repo}.git

但是,当使用SSH URL克隆时,不会出现这个问题:

git clone git@github.com:{username}/{repo}.git

关于git - 使用 git 更新子模块时出现 fatal error "could not read Username",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44646045/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com