! [remote rejected] main -> main (pre-receive hook declined) error: failed to push some refs to 'git.guangzitec.com:wuyue/eatstar.git'
时间: 2023-12-30 22:55:32 浏览: 187
Github—failed to push some refs to ‘https://github.com/***/git_project.git’解决办法
5星 · 资源好评率100%
当你在使用git push命令时,出现了类似于"! [remote rejected] main -> main (pre-receive hook declined) error: failed to push some refs to 'git.guangzitec.com:wuyue/eatstar.git'"的错误提示。这个错误通常表示你的推送被拒绝了,可能是因为一些原因导致的。其中一个可能的原因是你的本地分支与远程仓库的分支不一致。这可能是因为你在之前的提交中有一些未被推送到远程仓库的更改。解决这个问题的一种方法是执行git pull origin master --allow-unrelated-histories命令,这会将远程仓库的更改拉取到你的本地分支中。在执行这个命令后,你可能会发现你的本地多了一个新文件README.md。你需要将这个文件commit提交到本地,并将之前失败的提交一起推送。这样,你的推送应该就会成功了。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *3* [解决git报错[remote rejected] HEAD -> master (pre-receive hook declined) error: failed to push some....](https://blog.csdn.net/watfe/article/details/123692770)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *2* [Git发现git push origin master 报错的解决方法](https://download.csdn.net/download/weixin_38743602/14092211)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文