Go 1.18已解决 fatal: could not read Username for 'https://github.com': terminal prompts disabled

Environment

Go version 1.18.
Git version 2.32.0.
Github ssh credentials configured.

Supposed to work but not works.

  • env GIT_TERMINAL_PROMPT=1 go get github.com/xyz/abc
  • git config --global --add url."git@github.com:".insteadOf "https://github.com/"

Solution.

  1. export GOPRIVATE=github.com/{privateName}/*
  2. go get github.com/{privateName}/*

reference.

https://stackoverflow.com/a/65368910/7972695

posted @ 2022-05-09 08:55  略略略——  阅读(5826)  评论(0编辑  收藏  举报