Gitee推送本地仓库问题

问题描述

使用Gitee推送代码的时候出现下面问题:

git push -u origin master
[session-abcd1234] Auth error: Access deined: authorize failure.
fatal: Could not read from remote repository.

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

这是因为Gitee针对仓库的添加公钥只具备读权限。是用来部署用的。
在这里插入图片描述
个人仓库要具备读写权限,需要在个人设置里面添加公钥。
在这里插入图片描述

unrelated histories

在这里插入图片描述
如图所示,远程仓库已经有提交,本地文件新建了一个本地仓库,并关联到远程仓库中,此时push的时候,由于本地没有远程仓库已经提交的记录,pull的时候会失败,需要先pull下远程仓库的记录。

fatal: refusing to merge unrelated histories

解决方法是:

$git pull origin master --allow-unrelated-histories
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值