Push rejected Push main to origin/main was rejected by the remote
时间: 2023-11-25 11:12:20 浏览: 167
Push rejected: Push main to origin/main was rejected by the remote是因为git默认禁止推送到当前已检的分支。这是为了防止在推送过程中破坏正在工作的代码。为了解决这个问题,你需要进行一些设置。你可以在.git/config文件中添加以下代码:
```
<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [Push rejected: Push master to origin/master was rejected by remote](https://blog.csdn.net/qq_38242046/article/details/125960061)[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* *3* [Push master to origin/master was rejected by remote](https://blog.csdn.net/github_29667873/article/details/85064820)[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 ]
阅读全文