Go get报错 fatal: could not read Username for ‘https://xxx‘: terminal prompts disabled【解决方案】

原因:go get 默认使用https拉取源码,缺少ssh用户权限。

解决方案:

配置git config。

以GitHub为例:

 git config --global --add url."[email protected]:".insteadOf "https://github.es.ecg.tools/"

另外,补充一些go get相关的命令:

运行 go get -u 将会升级到最新的次要版本或者修订版本(x.y.z, z是修订版本号, y是次要版本号)
运行 go get -u=patch 将会升级到最新的修订版本
运行 go get package@version 将会升级到指定的版本号version

你可能感兴趣的:(golang,https,git)