0
我在嘗試在GIT上推送項目時遇到以下問題。如何在GIT推送期間忽略遠程更改?
推它,我得到這個錯誤信息:
$ git push origin master
To https://bitbucket.org/MyAccount/my-project.git
! [rejected] master -> master (fetch first)
error: failed to push some refs to 'https://[email protected]/MyAccount/my-projec.git'
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
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
如此看來,糾正我,如果我做錯了斷言,這對我的遠程倉庫也有,我還沒有在我的本地庫採取的變化和它建議我執行拉動來獲得這些變化。
這對我來說是一個問題,因爲本地版本是我的應用程序的最後一個明確版本,我不能冒險從遠程存儲庫中覆蓋某些舊的和錯誤的東西(或由someoneelse創建)。
我可以指定推送本地內容而不考慮遠程更改嗎?或者我該如何檢查我最後的本地提交和遠程內容之間的區別?
[Force git push覆蓋遠程文件]可能重複(http://stackoverflow.com/questions/10510462/force-git-push-to-overwrite-remote-files) – 1615903