美文网首页Go语言实践Go
【Golang】go get GitHub私有仓库

【Golang】go get GitHub私有仓库

作者: 研匠 | 来源:发表于2019-08-07 15:15 被阅读11次

go get GitHub私有仓库

go get github.com/user/project 命令内部使用 https://github.com/ git clone命令,默认只支持公有仓库,不支持私有仓库。如需要让go get支持私有仓库,则须按如下操作,使https://github.com/转为GitHub的Token访问:
1、前往 https://github.com/settings/tokens/new 产生一个Token,注意该Token必须包含repo权限。
2、执行命令
git config --global url."https://d04c1580f35b5b6aa3865a0fa2d003b320a5bea8:x-oauth-basic@github.com/".insteadOf "https://github.com/"
修改Git的global配置,注:d04c1580f35b5b6aa3865a0fa2d003b320a5bea8是Token。

Work! Work! Be happy to!

相关文章

网友评论

    本文标题:【Golang】go get GitHub私有仓库

    本文链接:https://www.haomeiwen.com/subject/wgiodctx.html