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

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章