git push时,由于github上改变,无法提交本地更新的解决方案

如题,由于在github上做了修改,在本地提交时出现了小小的错误:

 

error: failed to push some refs to '[email protected]:dearjohn/tutorial.git'

To prevent you from losing history, non-fast-forward updates were rejected

Merge the remote changes (e.g. 'git pull') before pushing again.  See the

'Note about fast-forwards' section of 'git push --help' for details.


错误中已经给出了初步的解决方案:
1.本地运行:git pull。目的是将本地之前一个版本的代码,与github上保持一致
2.运行gitpush,再将本地代码更新到github上

小问题,大牛绕道。

你可能感兴趣的:(ror)