windows下! [rejected] master -> master (non-fast-forward)错误解决

参考的地址

一、遇到的问题

在windows系统下学习第一次使用git push -u origin master的时候可能会报错

Enter passphrase for key '/c/Users/mao/.ssh/id_rsa':
To github.com:wdhhh/pm_504
 ! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to '[email protected]:wdhhh/pm_504'
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.

二、原因和解决办法

是因为github上有一个README.md 文件没有下载下来 。要先
git pull --rebase origin master ,然后git push -u origin master

三、小结

遇到不懂的问题还是不要慌。。多百度。。多查找解决办法~

猜你喜欢

转载自blog.csdn.net/qq_40916110/article/details/80633905