To https://github.com/........
! [rejected] master -> master (fetch first)
error: failed to push some refs to 'https://github.com/........'
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.
解決辦法有兩種
第一招:先拉再推
第二招:無視規則
我直接使用第二招,比較快速直接蓋過去,因為我在gitHub不小心添加版本紀錄與更改密碼。也跟本地端不同步因為gitHub裡面多一個版本,使用git push -f
就解決了,將原先的紀錄覆蓋掉。