报错:

Updates were rejected because the remote contains work that you do  not have locally. This is usually caused by another repository pushing to the same ref. You may want to first integrate the remote changes  (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

意思:

由于远程包含本地没有的工作,更新被拒绝。这通常是由另一个存储库推送到同一个ref引起的。您可能希望在再次推之前首先集成远程更改(例如,“git pull…”)。
提示:有关详细信息,请参阅“git push--help”中的“关于快进的说明”

原因:其他地方向同一远端库推送了代码,导致本地不是最新的

解决1:先从远端 pull 一下,执行:git pull

解决2:直接通过 VSCode 执行操作,VSCode 会先从远端拉下来再提交上去
在这里插入图片描述

Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐