Git 报错:Updates were rejected because the remote contains work that you do not have locally.
报错:Updates were rejected because the remote contains work that you donot have locally. This is usually caused by another repository pushing to the same ref. You may want to first integrate the remo...
文章共281字 · 阅读需要大约1分钟
一键AI生成摘要,助你高效阅读
问答
·
报错:
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 会先从远端拉下来再提交上去
更多推荐
已为社区贡献5条内容
所有评论(0)