git推送到远程仓库时常见问题

git push origin master 时提示Updates were rejected because the remote contains work that you do not have locally

解决方法:

在执行git push origin master 时先执行git pull origin master

如果出现fatal:refuseing to merge unrelated histories,则执行

git pull origin master --allow-unrelated-histories

最后再执行git push origin master

 

你可能感兴趣的:(git推送到远程仓库时常见问题)