zoukankan      html  css  js  c++  java
  • go get 下载包时提示 could not read Username

    问题

    在下载公司内部的包时,出现如下提示:

    go get: module example.com/somepkg/common: git ls-remote -q origin in /somepath/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx: exit status 128:
            fatal: could not read Username for 'https://xxx.example.com': terminal prompts disabled
    Confirm the import path was entered correctly.
    If this is a private repository, see https://golang.org/doc/faq#git_https for additional information.
    

    原因

    查询了下必应,大致原因是,下载包时,没有用户名和密码,导致没有权限,因此需要启用弹窗,以便输入用户名和密码。

    解决

    设置环境变量:GIT_TERMINAL_PROMPT 为 1

    也可以在你 go get example.com/some/pkg 时,直接设置:GIT_TERMINAL_PROMPT=1 go get -u example.com/path/yourpkg

    同时为了能在以后不用再输入用户名和密码,可以设定储存密码:

    git config --global credential.helper store
    

    参考

    持之以恒!
  • 相关阅读:
    发布SpringBoot项目到Docker容器
    Docker网络
    Docker镜像发布到阿里云
    Docker制作Tomcat镜像
    DockerFile指令
    Docker命令
    kafka安装与使用
    刷题第2天
    刷题第1天
    UVA 11107 Life Forms
  • 原文地址:https://www.cnblogs.com/ishenghuo/p/14962273.html
Copyright © 2011-2022 走看看