Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/231.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
无法从Android studio将新项目推送到bitbucket?_Android_Git_Android Studio_Bitbucket - Fatal编程技术网

无法从Android studio将新项目推送到bitbucket?

无法从Android studio将新项目推送到bitbucket?,android,git,android-studio,bitbucket,Android,Git,Android Studio,Bitbucket,我在Android Studio中创建了一个新项目。但我不能把它推到垃圾桶(我整天都在和它战斗,什么都不管用) 我得到这个错误: Push to origin/master was rejected error: failed to push some refs to 'https://aaa@bitbucket.org/bbb/ccc.git' hint: Updates were rejected because the remote contains work that you do hi

我在Android Studio中创建了一个新项目。但我不能把它推到垃圾桶(我整天都在和它战斗,什么都不管用)

我得到这个错误:

Push to origin/master was rejected
error: failed to push some refs to 'https://aaa@bitbucket.org/bbb/ccc.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
!   refs/heads/master:refs/heads/master [rejected] (fetch first)
hint: (e.g., 'git pull ...') before pushing again.
Done
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
我就是这么做的:

  • Android Studio(AS)->新项目
  • AS->VCS->启用版本控制集成->Git
  • AS->VCS->Git->Remotes->我添加了我在bitbucket中创建的存储库的URL
  • AS->右键单击project=>Git=>Commit&Push->ERROR
  • 有什么问题?我不理解错误信息,我没有任何“另一个存储库”,它只是我在做这个项目,它是新创建的

    当我尝试按照建议进行更改时,它也不起作用(我遇到另一个错误)。当我试着用谷歌搜索那个,我得到了一个又一个,很快我就迷路了…这很复杂


    我做错了什么?我只想把一个新项目推到bitbucket…

    好的,我解决了。我不知道git为什么一直给我这些随机错误(当回购协议和项目都是新的,只有几分钟的时候,这些错误消息没有多大意义),但这正是帮助我的原因:

    git push -f --set-upstream origin master
    

    我想这只是另一个证明,git是多么复杂和不直观。

    检查是否有人被推到master,而您的提交却在后面。在本例中,
    git获取原始主机
    ,然后合并代码。没有人推送任何东西-我创建的全新回购协议和我创建的全新项目。另外,没有人可以访问我的bitbucket,只有我一个人。我实际上只是完成了我在帖子中提到的4个步骤,我花了2分钟尝试使用
    git fetch origin master
    。现在我遇到另一个错误:
    更新被拒绝,因为您当前分支的提示已过期!refs/heads/master:refs/heads/master[已拒绝](非快进)完成提示:其远程对应项。在再次按下之前,集成远程更改(例如提示:“git pull…”)。提示:有关详细信息,请参阅“git推送--帮助”中的“关于快进的说明”。