亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

使用私有倉庫進行構建

使用私有倉庫進行構建

Go
一只斗牛犬 2022-08-01 15:05:34
我正在嘗試構建一個使用私有git存儲庫的go應用程序。我有一個用于我的github帳戶的ssh密鑰,并且在我的.gitconfig文件中有以下內容:[url "https://username:[email protected]"]    insteadOf = https://github.com[url "ssh://[email protected]/"]    insteadOf = https://github.com/當我執行go測試或去構建時,我被要求輸入密碼。然后我得到一個回復:go: found github.com/x/businesses in github.com/x/businesses v0.0.0-yygo: cmd/main/cmd imports  github.com/x/businesses: github.com/x/[email protected]/go.mod:   verifying module: github.com/x/[email protected]/go.mod:   reading https://sum.golang.org/lookup/github.com/xx/[email protected]: 410 Goneserver response:  not found: github.com/x/[email protected]:   invalid version: git fetch -f origin refs/heads/*:refs/heads/* refs/tags/*:refs/tags/*   in tmp/gopath/pkg/mod/cache/vcs/zz:     exit status 128:    fatal: could not read Username for 'https://github.com': terminal prompts disabled我嘗試在.gitconfig中刪除頂部而不是Of,沒有理由,然后嘗試一些東西。
查看完整描述

1 回答

?
哆啦的時光機

TA貢獻1779條經驗 獲得超6個贊

你的 git 配置應該看起來與你擁有的東西相似或相似。 [url "[email protected]:"] insteadOf = https://github.com/

然后,您可以通過告訴您使用這樣的私有存儲庫來獲取您的pakege:GoGOPRIVATE="github.com/your_username_or_org" go get github.com/name_or_org/repo_name

另外,我通常不會在我的SSH密鑰上放一個passprahse,因為每次都輸入它有點煩人,但當然,通過添加它更安全,就像評論中指出的那樣。


查看完整回答
反對 回復 2022-08-01
  • 1 回答
  • 0 關注
  • 158 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號