我無法使用以下命令更新 github.com 上存盤庫中的源代碼。
$ git push -u origin master
顯示以下錯誤:
! \[rejected\] master -\> master (fetch first)
error: failed to push some refs to 'https://github.com/\<username\>/my-history.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.
有沒有辦法做到這一點?
我想將源代碼推送到我的存盤庫中。
uj5u.com熱心網友回復:
幾天前我經歷了類似的事情。
你可以這樣做:
$ git remote add origin https://github.com/Dream0804/my-history.git
$ git push -f origin master
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/452560.html
