在寫個小項目,簡單說就是經過了階段a,階段b和階段c,階段c已經push到了遠端函式庫。
我現在在我的本地庫把版本reset到了階段b,現在我希望能重新push,覆蓋並捨棄已有的階段c,但是遭到了拒絕:
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'git@github.com:qianjiahao/chatroom.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
現在該如何操作才能覆蓋遠端程式庫的內容呢?
後來我就git pull,然後修改了後在push回去,不知道還有沒有其他的解決方法。
雷雷