git Push rejected: Push to origin/master was rejected问题

这句话的意思是git拒绝合并两个不相干的东西 
此时你需要在打开Git Bash,然后进入相应的目录,然后敲git命令

$ git pull origin master --allow-unrelated-histories

出现类似于这种信息就说明pull成功了:

$ git pull origin master --allow-unrelated-histories
From https://github.com/yanghaopeng/python_utils
 * branch            master     -> FETCH_HEAD
Merge made by the 'recursive' strategy.
 utils/hello.py | 354 ++++++++++++++++++++++++++++++++++++++++++++++++++++-----
file changed, 323 insertions(+), 31 deletions(-)

将本地仓库中的推送到github中,使用如下的git命令:

$ git push -u origin master
发布了23 篇原创文章 · 获赞 5 · 访问量 1万+

猜你喜欢

转载自blog.csdn.net/zqd1984309864/article/details/104631392