4 回答

TA貢獻1811條經驗 獲得超4個贊
GitLab 的相關位:
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"
希望對您有所幫助。

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

TA貢獻1856條經驗 獲得超5個贊
做這個
git config --global --add url."[email protected]:".insteadOf "https://your-repo.com/"
export GOPRIVATE='your-repo.com'
確保你的 git clone 通過 ssh 工作。
- 4 回答
- 0 關注
- 140 瀏覽
添加回答
舉報