无法从Android studio将新项目推送到bitbucket?
我在Android Studio中创建了一个新项目。但我不能把它推到垃圾桶(我整天都在和它战斗,什么都不管用) 我得到这个错误:无法从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
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.
我就是这么做的:
我做错了什么?我只想把一个新项目推到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推送--帮助”中的“关于快进的说明”。