Node.js: 處理錯誤 "failed to push some refs to '[...]'"
此文件屬於快速開始指南的一部分。請在此處查看完整指南:學習如何在 Stackhero 上快速且安全地部署 Node.js 服務。
👋 歡迎瀏覽 Stackhero 文件!
Stackhero 為您提供即用型 Node.js cloud 環境,助您加快開發進度:
- 只需一個簡單的
git push,即可於數秒內部署至生產環境,無需額外工具或手動設定。- 可自訂您的網域名稱,並享有自動配置 HTTPS 憑證,讓您的應用程式安全無憂,無需額外設定。
- 自動備份、一鍵更新及可預測的收費模式,讓您專注於開發功能,Stackhero 會為您管理基礎設施。
- 建基於專屬私有基礎設施,確保穩定效能及高度安全。
節省時間,減少營運負擔:您只需幾分鐘,即可於 Stackhero 的 Node.js cloud hosting 上運行您的應用程式。
如果遇到以下錯誤:
error: failed to push some refs to '[...]'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: 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.
這代表您的本地儲存庫與遠端不同步。您可以強制推送:
git push -f stackhero main