remote: 找不到你要找的项目或者你没有权限查看

remote: The project you were looking for could not be found or you don't have permission to view it

我在尝试通过 gitlab 部署我的分支时遇到此错误。

remote: The project you were looking for could not be found or you don't have permission to view it.
fatal: repository 'https://gitlab.com/[group_name]/[repo_name].git/' not found
error: Could not fetch origin

我设法解决了我的问题。如果您遇到同样的问题,请按照以下步骤操作:

  • 重命名您的旧远程跟踪:

git remote rename origin old_origin

  • 添加新遥控器:

git remote add origin https://[gitlab_username]@gitlab.com/[group_name]/[repo_name].git

  • 您可能还必须将默认遥控器设置为原点:

git config --add checkout.defaultRemote origin

  • 最后,如果需要,您可以删除 old_origin(可选)。