git - 如何解决“远程:您 (@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 的人在我之前正在处理不同的存储库。我正在使用的存储库是几个月前创建的,此人未添加为成员。
解决方案
@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 钥匙串更新凭据”)
推荐阅读
- python - 在 lightkurve 中使用 Box Least Squares 时出错
- python - astype 是否编辑原始数据框?
- r - 数据类型转换导致 R 中的 NULL 值
- java - 有没有办法在 Java 中获取活动 Kubernetes Pod 的数量
- sql - 如何从由两个属性组成的主键中仅引用一个属性作为外键
- ios - Auth0 获取未通过身份验证的元数据
- python - 如何在 Python 中计算文件中单词的频率?
- c# - C# - 在字符串列表列表中重复而不是正确的值
- javascript - SyntaxError:编译 ejs 时 index.ejs 中出现意外标识符
- r - 如何使“dplyr select”使用字符参数的值而不是其名称作为文字?