簡體   English   中英

無法從 Android 工作室向 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.

這就是我所做的:

  1. Android 工作室 (AS) -> 新項目
  2. AS -> VCS -> 啟用版本控制集成 -> Git
  3. AS -> VCS -> Git -> Remotes -> 我添加了我在 bitbucket 中創建的存儲庫 URL
  4. AS -> 右鍵單擊項目 => Git => 提交並推送 -> 錯誤

問題是什么? 我不明白錯誤消息,我沒有任何“另一個存儲庫”,只有我在處理這個項目,而且它是新創建的。

當我嘗試遵循 PULL 更改的建議時,它也不起作用(我收到另一個錯誤)。 當我嘗試用谷歌搜索那個時,我得到了一個又一個,很快我就迷路了……它非常復雜。

我究竟做錯了什么? 我只想推一個新項目到bitbucket...

好的,我解決了。 我不知道為什么 git 一直給我那些隨機錯誤(當 repo 和項目都是新鮮的並且只有幾分鍾的時候,這些錯誤消息 ddint 很有意義),但這有幫助:

git push -f --set-upstream origin master

我想這只是 git 是多么復雜和不直觀的另一個證明。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM