Git not pushing project
Answered
Hi, I was using github to with my maven project but now I need to move my project over to bitbucket. I changed the remote to my bitbucket url but when I try to push I get this error:
hint: Updates were rejected because the remote contains work that you do
To https://bitbucket.org/sometext/mygit.git
hint: not have locally. This is usually caused by another repository pushing
! refs/heads/master:refs/heads/master [rejected] (fetch first)
hint: to the same ref. You may want to first integrate the remote changes
Done
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
When I try to pull I get the error:
* branch master -> FETCH_HEAD
* [new branch] master -> origin/master
fatal: refusing to merge unrelated histories
When I try to add the files, commit, push and pull from the terminal in intellij it works fine, even when I do a git pull with--allow-unrelated-histories it works in the terminal but when i try to pull or push in intellij I get the same errors. How can I get the builtin git to work with bitbucket instead of using the terminal?
I even did a git fetch, git merge and I get the same errors.
Please sign in to leave a comment.
So, to summarize,
Is this correct?
BTW, there is no builtin git in IntelliJ, it uses a standalone git client, that is configured in Settings - Version Control - Git.
Yeah that is correct.
This is still the git error, and since external git is used, you should actually get the same in the command line.
Check if executing exactly the same command as IDE works on the command line. You could find the executed command in the COnsole tab of the Version control toolwindow.
Also make sure the git executable specified in Settings | Version Control | Git is the same you use on the command line.