git 报错 You are not allowed to push code to this project 的解决办法


前言


一、使用库的时候

错误展示

在这里插入图片描述

You are not allowed to push code to this project

Please make sure you have the correct access rights
and the repository exists.

通过linux项目分支上 push 代码的时候,出现了上面的提示。
无法Push上去 说我没有权限 然后一查看才发现用户名用的不是之前那个

解决方式

查询一下:

git config user.name
git config user.email

或者

git config --list

直接重新设置一下就好了

git config --global user.name XXX
git config --global user.email xxxxxxx

在查询一下 之前的账户就回来了

参考了一些网上的 但是AC git 还是更新不上去 于是找了很多版本
由于自己第一次登陆是通过ssh-key的那种形式 所以只需要执行

ssh-keygen 

然后按回车回车
在这里插入图片描述
然后是这种 需要在找到ssh/里面的

cat id_rsa.pub
 

复制下来之后在粘贴到
在这里插入图片描述
这下就可以通过两个账户进行访问了

posted @   依嘫  阅读(470)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 分享4款.NET开源、免费、实用的商城系统
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· 上周热点回顾(2.24-3.2)
点击右上角即可分享
微信分享提示