【问题标题】:Not able to import private gitlab repository [duplicate]无法导入私有 gitlab 存储库 [重复]
【发布时间】:2020-03-02 14:26:45
【问题描述】:

我正在尝试将私有 gitlab 存储库导入到我的 Go 代码中。 我想使用用户访问令牌进行身份验证。有没有办法可以在导入命令中传递访问令牌。

我尝试在导入命令中使用基本的 oauth2 url,但导入命令只接受路径。

【问题讨论】:

    标签: go gitlab go-get


    【解决方案1】:

    你可以运行命令

    git config --global url.git@gitlab.com:.insteadOf https://gitlab.com/
    

    然后再试一次,它会使用你的 git 凭证与 gitlab 一起工作。

    例如,您的存储库位于https://gitlab.com/yourname/hello

    你跑

    go get gitlab.com/yourname/hello
    

    【讨论】:

      猜你喜欢
      • 2021-02-24
      • 1970-01-01
      • 2014-08-19
      • 2018-10-26
      • 2015-07-24
      • 2014-10-30
      • 1970-01-01
      • 1970-01-01
      • 2022-10-13
      相关资源
      最近更新 更多