我在本地有一个项目,我想在Bitbucket上分享。我在bitbucket上创建了一个名为“rest api”的存储库。
现在,我进入了我的intellij idea ide,并且已经将项目添加到git中。我还使用idea将项目添加到远程存储库中。
现在,我正试图将我的项目推到远程,但这给了我一个错误:
error: failed to push some refs to 'https://my@bitbucket.org/my/rest-api.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
To https://bitbucket.org/my/rest-api.git
! refs/heads/master:refs/heads/master [rejected] (non-fast-forward)
Done
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
我读了一些这样的问题,知道我需要首先
git pull
是的。所以我也试过了,但那也给了我一个错误:
Git Pull Failed
From https://bitbucket.org/my/rest-api
* branch master -> FETCH_HEAD
= [up to date] master -> origin/master
refusing to merge unrelated histories
我做错什么了?