4 回答

TA貢獻(xiàn)1811條經(jīng)驗(yàn) 獲得超4個(gè)贊
GitLab 的相關(guān)位:
git config --global \
? url."https://oauth2:${personal_access_token}@privategitlab.com".insteadOf \
? "https://privategitlab.com"
#or?
git config --global \
? url."https://${user}:${personal_access_token}@privategitlab.com".insteadOf \
? "https://privategitlab.com"
希望對(duì)您有所幫助。

TA貢獻(xiàn)1874條經(jīng)驗(yàn) 獲得超12個(gè)贊
您應(yīng)該使用 SSH 密鑰來(lái)獲取您的存儲(chǔ)庫(kù),檢查您的 SSH 密鑰是否也在系統(tǒng)鑰匙串中:
ssh-add -K ~/.ssh/id_rsa

TA貢獻(xiàn)1806條經(jīng)驗(yàn) 獲得超8個(gè)贊
鑒于這樣的私人倉(cāng)庫(kù)經(jīng)常處于積極開(kāi)發(fā)中,我個(gè)人只是將其克隆到我的“適當(dāng)”位置$GOPATH
并像使用任何其他項(xiàng)目一樣使用源代碼管理(例如 git)。在 Rodrigo 的回答中添加 SSH 密鑰非常好,但是如果您正在積極開(kāi)發(fā)私有存儲(chǔ)庫(kù),那么將它克隆到正確目錄的額外步驟無(wú)論如何都不是一個(gè)困難的步驟go get
。
因此,例如,對(duì)于托管在 Github 上的私人倉(cāng)庫(kù),我cd
會(huì)$GOHOME/src/github.com/git-username-for-repo
git clone the-repo

TA貢獻(xiàn)1856條經(jīng)驗(yàn) 獲得超5個(gè)贊
做這個(gè)
git config --global --add url."git@your-repo.com:".insteadOf "https://your-repo.com/"
export GOPRIVATE='your-repo.com'
確保你的 git clone 通過(guò) ssh 工作。
- 4 回答
- 0 關(guān)注
- 136 瀏覽
添加回答
舉報(bào)