解决上传代码到GitLab报错Push rejected: Push to origin/master was rejected的解决方案

在Push的时候出现报错提示Push rejected: Push to origin/master was rejected,
网上大多的方案是在项目文件夹反键执行git Bash Here打开窗口去执行:
第一种

git pull

git pull origin master

git pull origin master –allow-unrelated-histories

第二种
git pull origin master –allow-unrelated-histories
git push -u origin master -f

我尝试过后都没能解决我以知的还有两种可能性:
第一种
你是重别人的git或者公司的git拉取下来的,你没有push的权限;
第二种
因为种种原因新建了一个项目,想要push上去,项目名字和git里的项目名字是一样的,也会导致报这个错

Logo

瓜分20万奖金 获得内推名额 丰厚实物奖励 易参与易上手

更多推荐