0x01 错误信息

git 推送代码到远程仓库报错,错误信息如下:

1
2
remote: The project you were looking for could not be found or you don't have permission to view it.
fatal: repository 'http://1x.xx.x.xx/bigdata/fr-xxx-plugin.git/' not found

出现问题的原因是通过其他账号拉取过gitlab中其他仓库的代码,新拉代码的仓库对原来用户没有权限。相当于,需要删掉缓存的用户,重新用有权限的账号拉取。

0x02 解决方法

  • 第一步
    清除本地 git 账户,重新输入用户名密码
1
git config --system --unset credential.helper
  • 第二步

避免每次git操作都要输入账号密码

1
git config --global credential.helper store