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 dohint: not have locally. This is usually caused by another repository pushinghint: to the same ref. You may want to first integrate the remote changeshint: (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
就解决了,将原先的纪录覆盖掉。
【状况题】怎么有时候推不上去…