git在push时报错:! [rejected] master -> master (non-fast-forward) error: failed to push some refs to

解决办法:
1.git fetch origin master
2. git merge origin FETCH_HEAD
然后再push origin master 就可以了,原因是首先应该从远程拉取最新代码,再add和commit,最后push

你可能感兴趣的:(git,github)