无法将新项目从 Android studio 推送到 bitbucket?
Cant push new project to bitbucket from Android studio?
我在 Android Studio 中创建了一个新项目。但是我不能把它推到bitbucket(我和它吵了一整天,没有任何效果)。
我收到这个错误:
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 -> 我添加了 URL 我在 bitbucket
中创建的存储库
- AS -> 右键单击项目 => Git => 提交并推送 -> 错误
问题是什么?我不明白错误消息,我没有任何“另一个存储库”,只有我在处理这个项目,而且它是新创建的。
当我尝试按照建议进行 PULL 更改时,它也不起作用(我收到另一个错误)。当我尝试 google 那个时,我又得到一个又一个,很快我就迷路了……它非常复杂。
我做错了什么?我只想将一个新项目推送到 bitbucket...
好的,我解决了。我不知道为什么 git 一直给我那些随机错误(当 repo 和项目都是新鲜的并且只有几分钟的时候,这些错误消息 ddint 很有意义),但这就是帮助:
git push -f --set-upstream origin master
我想这只是另一个证明 git 是多么复杂和不直观。
我在 Android Studio 中创建了一个新项目。但是我不能把它推到bitbucket(我和它吵了一整天,没有任何效果)。
我收到这个错误:
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 -> 我添加了 URL 我在 bitbucket 中创建的存储库
- AS -> 右键单击项目 => Git => 提交并推送 -> 错误
问题是什么?我不明白错误消息,我没有任何“另一个存储库”,只有我在处理这个项目,而且它是新创建的。
当我尝试按照建议进行 PULL 更改时,它也不起作用(我收到另一个错误)。当我尝试 google 那个时,我又得到一个又一个,很快我就迷路了……它非常复杂。
我做错了什么?我只想将一个新项目推送到 bitbucket...
好的,我解决了。我不知道为什么 git 一直给我那些随机错误(当 repo 和项目都是新鲜的并且只有几分钟的时候,这些错误消息 ddint 很有意义),但这就是帮助:
git push -f --set-upstream origin master
我想这只是另一个证明 git 是多么复杂和不直观。