git在Rstudio推送的时候提示如下错误:
$ git push origin dev
To http://xxxxxx/Android.git
! [rejected] dev -> dev (fetch first)
error: failed to push some refs to ‘http://xxxxxx/Android.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
,然后再push