{"id":316,"hash":"f08118f79a1573754aa9c372a3eb6d2d59bd6f90afc4d7953f03a56fe44510e1","pattern":"go get results in &#39;terminal prompts disabled&#39; error for GitHub private repo","full_message":"I created the private repo examplesite/myprivaterepo using the GitHub UI from my browser.\n\nThen I went to my go directory (on the desktop) and cloned it:\n\n$ cd $GOPATH\n$ go get github.com/examplesite/myprivaterepo\n\nSo far so good. Created the file scheduler.go, added to repo and pushed.\n\n$ vim scheduler.go\n$ git add scheduler.go\n$ git commit\n$ git push\n\nEverythng's OK. But when I went to a clean laptop  and tried to clone the repo, I got an error:\n\n# Now on laptop, which doesn't yet know about the repo\n$ cd $GOPATH\n$ go get github.com/examplesite/myprivaterepo\n# At this point it should ask for my user ID and password ,right? But it doesn't.\n# Instead, this error occurs:\ncd .; git clone https://github.com/examplesite/myprivaterepo /Users/tom/go/src/github.com/examplesite/myprivaterepo\nCloning into '/Users/tom/go/src/github.com/examplesite/myprivaterepo'...\nfatal: could not read Username for 'https://github.com': terminal prompts disabled\npackage github.com/examplesite/myprivaterepo: exit status 128\n\nWhy is my laptop hating on my own repo and how can I get it to accept its fate?\n\nThanks.","ecosystem":"go","package_name":"git","package_version":null,"solution":"It complains because it needs to use ssh instead of https but your git is still configured with https. so basically as others mentioned previously you need to either enable prompts or to configure git to use ssh instead of https. a simple way to do this by running the following:\n\ngit config --global --add url.\"git@github.com:\".insteadOf \"https://github.com/\"\n\nor if you already use ssh with git in your machine, you can safely edit ~/.gitconfig and add the following line at the very bottom\n\nNote: This covers all SVC, source version control, that depends on what you exactly use, github, gitlab, bitbucket)\n\n# Enforce SSH\n[url \"ssh://git@github.com/\"]\n  insteadOf = https://github.com/\n[url \"ssh://git@gitlab.com/\"]\n        insteadOf = https://gitlab.com/\n[url \"ssh://git@bitbucket.org/\"]\n  insteadOf = https://bitbucket.org/\n\nIf you want to keep password pompts disabled, you need to cache password. For more information on how to cache your github password on mac, windows or linux, please visit this page.\n\nFor more information on how to add ssh to your github account, please visit this page.\n\nAlso, more importantly, if this is a private repository for a company or for your self, you may need to skip using proxy or checksum database for such repos to avoid exposing them publicly.\n\nTo do this, you need to set GOPRIVATE environment variable that controls which modules the go command considers to be private (not available publicly) and should therefore NOT use the proxy or checksum database.\n\nThe variable is a comma-separated list of patterns (same syntax of Go's path.Match) of module path prefixes. For example,\n\nexport GOPRIVATE=*.corp.example.com,github.com/mycompany/*\n\nOr\n\ngo env -w GOPRIVATE=github.com/mycompany/*\n\nFor more information on how to solve private packages/modules checksum validation issues, please read this article.\nFor more information about go 13 modules and new enhancements, please check out Go 1.13 Modules Release notes.\n\nOne last thing not to forget to mention, you can still configure go get to authenticate and fetch over https, all you need to do is to add the following line to $HOME/.netrc\n\nmachine github.com login USERNAME password APIKEY\n\nFor GitHub accounts, the password can be a personal access tokens.\nFor more information on how to do this, please check Go FAQ page.\n\nPlease feel free to leave a comment in case you want more support or help.","confidence":0.95,"source":"stackoverflow","source_url":"https://stackoverflow.com/questions/32232655/go-get-results-in-terminal-prompts-disabled-error-for-github-private-repo","votes":472,"created_at":"2026-04-19T04:41:52.370621+00:00","updated_at":"2026-04-19T04:52:38.787308+00:00"}