Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fatal error "could not read Username" when update submodule using git

I've encountered a strange issue, and searched for a long time with no solution.

I have a main project named lapp-yhkt(local path: /g/webstorm/lapp-yhkt):enter image description here

and the content of .gitmodules :enter image description here

At this directory, I take the steps from Git-Tools-Submodules:

First init submodule,

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

the update it and get 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

After these, I also tried git submodule sync and 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

But same error occur to me, it's frustrated. Hope anyone can save me and thanks in advance.

EDIT: I used git in windows.

like image 237
Blank Avatar asked Sep 04 '25 17:09

Blank


1 Answers

Solution :

This problem occurrs when one cloned using HTTPS URL and then tried to push the changes using Git Bash on Windows using:

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

However, when one used SSH URL to clone, this problem doesn't occur:

git clone [email protected]:{username}/{repo}.git
like image 160
LuFFy Avatar answered Sep 07 '25 07:09

LuFFy