go get results in 'terminal prompts disabled' error for github private repo [英] go get results in 'terminal prompts disabled' error for github private repo
问题描述
我使用浏览器中的 Github UI 创建了私有存储库 examplesite/myprivaterepo.
I created the private repo examplesite/myprivaterepo using the Github UI from my browser.
然后我转到我的 go 目录(在桌面上)并克隆它:
Then I went to my go directory (on the desktop) and cloned it:
$ cd $GOPATH
$ go get github.com/examplesite/myprivaterepo
到目前为止一切顺利.创建文件 scheduler.go,添加到 repo,并推送.
So far so good. Created the file scheduler.go, added to repo, and pushed.
$ vim scheduler.go
$ git add scheduler.go
$ git commit
$ git push
一切正常.但是当我找到一台干净的笔记本电脑并尝试克隆存储库时,出现错误:
Everythng's OK. But when I went to a clean laptop and tried to clone the repo, I got an error:
# Now on laptop, which doesn't yet know about the repo
$ cd $GOPATH
$ go get github.com/examplesite/myprivaterepo
# At this point it should ask for my user ID and password ,right? But it doesn't.
# Instead, this error occurs:
cd .; git clone https://github.com/examplesite/myprivaterepo /Users/tom/go/src/github.com/examplesite/myprivaterepo
Cloning into '/Users/tom/go/src/github.com/examplesite/myprivaterepo'...
fatal: could not read Username for 'https://github.com': terminal prompts disabled
package github.com/examplesite/myprivaterepo: exit status 128
为什么我的笔记本电脑讨厌我自己的回购,我怎样才能让它接受它的命运?谢谢.
Why is my laptop hating on my own repo and how can I get it to accept its fate? Thanks.
推荐答案
go get 默认禁用终端提示".这可以通过设置 git 的环境变量来改变:
go get disables the "terminal prompt" by default. This can be changed by setting an environment variable of git:
env GIT_TERMINAL_PROMPT=1 go get github.com/examplesite/myprivaterepo
这篇关于go get results in 'terminal prompts disabled' error for github private repo的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!