本问题已经有最佳答案,请猛点这里访问。
我在Github控制台上创建了新的repo。
在Android Studio中,承诺并尝试推到远程,推被拒绝。
在Studio中,我可以成功地与Github建立连接。
尝试使用Android Studio进行Git Pull,获得:< BR>
Git Pull Failed: fatal: refusing to merge unrelated histories
即使在Git-Bash中也得到了:
>git push origin master
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.
号
嘿,我解决了我的问题,链接中的答案清楚地表明,"在一个罕见的事件中使用的选项,合并了两个独立开始他们生活的项目的历史。"我的解决方案很简单,希望能帮助别人!
In Android Studio,
转到master,mater-->rebase on-->你会得到:
Rebase Successful: Rebased master on origin/master
号
然后使用Android Studio进行推送。
。