问题描述
使用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