项目结构变更或过多文件增加但未commit再次提交git时经常会出现这个问题,为了加深自己印象记录下解决方案
$ git push origin master
To https://github.com/YuYanQing5920/UiAutomationFramework.git
! [rejected] master -> master (fetch first)
error: failed to push some refs to 'https://github.com/YuYanQing5920/UiAutomationFramework.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.
结合其它博文讲述的方法、先pull保持本地与远程仓库一致性后提交、依然还是会报错
$ git pull --rebase origin master
$ git push origin master
To https://github.com/YuYanQing5920/UiAutomationFramework.git
! [rejected] mast