Git 報錯:Updates were rejected because the remote contains work that you do not have locally.

報錯:javascript

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.

意思:java

因爲遠程包含本地沒有的工做,更新被拒絕。這一般是由另外一個存儲庫推送到同一個ref引發的。您可能但願在再次推以前首先集成遠程更改(例如,「git pull…」)。
提示:有關詳細信息,請參閱「git push--help」中的「關於快進的說明」

緣由:其餘地方向同一遠端庫推送了代碼,致使本地不是最新的git

解決1:先從遠端 pull 一下,執行:git pullweb

解決2:直接經過 VSCode 執行操做,VSCode 會先從遠端拉下來再提交上去
在這裏插入圖片描述svg