首页 > 解决方案 > 如何解决“远程:您 (@user) 必须接受服务条款才能执行此操作。” 问题?

问题描述

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

远程:您 (@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

我在这里找到的!

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

标签: git

解决方案


@user 不是我

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

git config credential.helper

您可以:

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

     git credential-manager reject gitlab.com
    

(在 MacOS 上:请参阅“管理遥控器 / 从 OSX 钥匙串更新凭据 从 OSX 钥匙串更新凭据”)


推荐阅读