git push origin master提示error:failed to push som refs to .......

问题

输入$ git push origin master,提示出错信息:error:failed to push som refs to …

解决

解决办法如下:

  1. 先输入
// 先把远程服务器github上面的文件拉下来
$ git pull origin master 
  1. 再输入
$ git push origin master
  1. 如果出现报错 fatal: Couldn’t find remote ref master或者fatal: ‘origin’ does not appear to be a git repository以及fatal: Could not read from remote repository,则需要重新输入
$ git remote add origin [email protected]:djqiang/gitdemo.git

你可能感兴趣的:(git)