Git错误日志--! [rejected]

 

git pull --rebase origin master
git push -u origin master

 当出现下面错误时 ,是因为和仓库两端版本不一致时,常见于刚创建仓库时,中只有readme文件的情况.执行下面的运行完毕之后.再push到仓库即可

 ! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to 
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
git pull origin master --allow-unrelated-histories

原文地址:https://www.cnblogs.com/robertx/p/10793142.html