2017-04-07 48 views
-1

我在Github控制台上创建了新的Repo。
在Android Studio中,承诺并试图推送到远程,推送被拒绝。git push拒绝,拉不合格:致命:拒绝合并无关历史

在工作室里,我能够与github建立成功的连接。

尝试Git的拉采用了android工作室,得到了:

Git Pull Failed: fatal: refusing to merge unrelated histories 

即使在混帐bash中得到这个:

>git push origin master<br/> 
To https://github.com/XXXX.git 
! [rejected]  master -> master (fetch first) 
error: failed to push some refs to 'https://github.com/XXX.git' 
hint: Updates were rejected because the remote contains work that you do 
hint: not have locally. This is usually caused by another repository pushing 
hint: to the same ref. You may want to first integrate the remote changes 
hint: (e.g., 'git pull ...') before pushing again. 
hint: See the 'Note about fast-forwards' in 'git push --help' for details. 
+1

嘿,我解决我的问题,在链接,答案清清楚楚地写着“选项,在合并独立地开始了他们的生活两个项目的历史罕见的事件中使用。”我的解决方案很简单,希望能帮助别人! – AskQ

回答

1
In Android Studio, 

去掌握,母校 - >变基onto- - > 您得到:

Rebase Successful: Rebased master on origin/master 

然后用android studio推送。

enter image description here