[Golang] go get: fatal: could not read Username for 'xxx': terminal prompts disabled

1. Error 1: fatal: could not read Username for 'https://github.com': terminal prompts disabled The issue appears when I tried to download a private golang repository by the command go get github.com/oscarzhou/private-helloworld. The completed error shows as below: % go get github.com/oscarzhou/private-helloworld go: module github.com/oscarzhou/private-helloworld: git ls-remote -q origin in /Users/oscarzhou/go/pkg/mod/cache/vcs/c5fb5660c8bfa54f1b957fc4e651ac76f19b939fc9015bf3bcbc21a34c925af7: exit status 128: fatal: could not read Username for 'https://github.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. If you have already googled this issue, you may find that most of the answers tell you to configure your git as shown below: ...

DigitalOcean Referral Badge
Sign up to get $200, 60-day account credit !