报错信息:Git error. Command: git clone --mirror [https://e.coding.net/kdk/flutter_oss_upload/flutter_oss_upload.git](https://e.coding.net/kdk/flutter_oss_upload/flutter_oss_upload.git) D:\flutter.pub-cache\git\cache\flutter_oss_upload-58eff7e5ef0518daa1d4d735069408b579dbe66f
Cloning into bare repository 'D:\flutter.pub-cache\git\cache\flutter_oss_upload-58eff7e5ef0518daa1d4d735069408b579dbe66f'...
bash: /dev/tty: No such device or address
error: failed to execute prompt script (exit code 1)
fatal: could not read Username for '[https://e.coding.net':](https://e.coding.net%27/) No error
背景:制作flutter插件,放coding私有库上,在pubspec.yaml 中引用,pub get时就报如上错误 。引用代码如下:
dependencies:
flutter:
sdk: flutter
flutter_localizations:
sdk: flutter
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^0.1.2
hb_oss_upload:
git:
url: https://e.coding.net/kdk/flutter_oss_upload/flutter_oss_upload.git
ref: common
排查了好久,终于发现问题并解决了,记录一下,希望能帮助遇到相同问题的小伙伴们。原因是:开始在Windows上安装git时,系统弹出Git Credential Manager for Windows,我输入的用户名和密码不是获取coding代码的用户名和密码,所以遇到了上面的问题。
解决方法:需要重新在Windows 的网络密码管理中心就可以修改密码(路径:WIN 7在‘控制面板’---‘用户账户’---‘管理Windows凭据’)。
不过在mac的Android studio上的Terminal中,我直接使用git命令行(git pull origin master),会让我重新输入用户名和密码,后来直接可以用了。
如果不会改。直接删除安装的git ,重新安装git,使用git时会弹Git Credential Manager for Windows窗口,重新输入正确的用户名和密码就行了。