发布时间:2024-06-27 13:01
Push rejected: Push to origin/master was rejected
有很多解决方案介绍:
在项目目录下运行命令:
git pull
git pull origin master
但是运行命令时又出错:
git pull“No remote repository specified”
这时需要更改本地项目仓库目录下.git 中的config配置文件:
修改“.git”文件夹里面的“config”文件的url就可以了:
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
ignorecase = true
precomposeunicode = false
[remote “origin”]
url = https://github.com/checkfrank/checkfrank.github.io.git
fetch = +refs/heads/*:refs/remotes/origin/*
pushurl = https://github.com/checkfrank/checkfrank.github.io.git
[branch “master”]
remote = origin
merge = refs/heads/master
把其中下面两项换成你的项目地址就可以了:
url = https://github.com/xxx/xxx.git
pushurl = https://github.com/xxx/xxx.git