報錯信息: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
排查了好久的畴,終于發(fā)現(xiàn)問題并解決了渊抄,記錄一下,希望能幫助遇到相同問題的小伙伴們丧裁。原因是:開始在Windows上安裝git時护桦,系統(tǒng)彈出Git Credential Manager for Windows,我輸入的用戶名和密碼不是獲取coding代碼的用戶名和密碼渣慕,所以遇到了上面的問題嘶炭。
解決方法:需要重新在Windows 的網(wǎng)絡(luò)密碼管理中心就可以修改密碼(路徑:WIN 7在‘控制面板’---‘用戶賬戶’---‘管理Windows憑據(jù)’)抱慌。
不過在mac的Android studio上的Terminal中,我直接使用git命令行(git pull origin master)眨猎,會讓我重新輸入用戶名和密碼抑进,后來直接可以用了。
如果不會改睡陪。直接刪除安裝的git 寺渗,重新安裝git,使用git時會彈Git Credential Manager for Windows窗口兰迫,重新輸入正確的用戶名和密碼就行了信殊。