【问题标题】:How to resolve "remote: You (@user) must accept the Terms of Service in order to perform this action." issue?如何解决“远程:您 (@user) 必须接受服务条款才能执行此操作。”问题?
【发布时间】:2021-04-04 13:24:32
【问题描述】:

我试图将我的本地分支代码推送到新 repo 的 master。这些是 Gitlab 存储库。但我不断收到此错误 -

remote:您 (@user) 必须接受服务条款才能执行此操作。请从网络浏览器访问 GitLab 以接受这些条款。 致命:无法访问“https://gitlab.com/project/project-ios.git/”:请求的 URL 返回错误:403

@user 不是我。我不知道发生了什么。

我提交了我的本地分支,在 gitlab 上打开另一个远程并在终端上写了

git push https://gitlab.com/new_project/new_project-ios +local_branch:master

我找到了here!。

@user 的人在我之前正在处理不同的 repo。我正在使用的存储库是几个月前创建的,此人未添加为成员。

【问题讨论】:

    标签: git


    【解决方案1】:

    @user 不是我

    这意味着您的本地 Git 安装必须使用已缓存“用户”凭据的凭据助手

    git config credential.helper
    

    你可以:

    • 使用 SSH URL (git remote set-url origin git@gitlab.com:new_project/new_project-ios),前提是您已将 SSH 密钥注册到 GitLab 帐户
    • delete the credentials

       git credential-manager reject gitlab.com
      

    (在 MacOS 上:参见“Managing Remotes / Updating credentials from the OSX Keychain Updating credentials from the OSX Keychain”)

    【讨论】:

    • 谢谢。您可以更改问题的用户名吗?
    • @SomoyDasGupta 没问题。我刚做了。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-07-24
    • 2020-04-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多