9

I initiated my git repo in my IntelliJ IDEA project. Then I click on share via Bitbucket under "Import into Version Control" Note: I've installed the plugin from jetbrains repository.

All works fine, I even am able to create the repo on Bitbucket, but when I try to push, nothing happens. When I try again through VCS > GIT > Push, it says that there are no remotes defined.

Please help. I mean, there's no error message nothing. I manage to push to github just fine though.

Games Brainiac
  • 80,178
  • 33
  • 141
  • 199

4 Answers4

10

Following this answer, you might need to open the "Git Bash", and define a remote:

git remote add origin http//IP/path/to/repository
git push -u origin master

In IntelliJ IDEA right-click on project select Synchronize 'YourProject'

For the reason behind the '-u' (upstream branch) option, see:
"Why do I need to explicitly push a new branch?".

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Thank you so much for this. I really do not know why bitbucket integration sucks like this, when GitHub integration is simply sublime in intelliJ. Thank you so much for this. I appreciate it. – Games Brainiac Jul 01 '13 at 06:39
  • I had a slightly different problem: Intellij was saying everything was fine, but opening my repo on bitbucket (from a browser) showed no commits. Doing `git push -u origin master` from Git bash worked instantly. Thanks @VonC :-) – Chthonic Project Dec 14 '13 at 23:09
8

I've created a youtube Video addressing this issue. Thanks @VonC for your help.

http://www.youtube.com/watch?v=klfLSRXUOzY

Games Brainiac
  • 80,178
  • 33
  • 141
  • 199
2

Actually problem is intellj plugin has some problem in adding remote to repo when it was shared via plugin, so it is mandatory to add the remote manually It is not necessary to execute push command since it can be done from IDE itself. Need to execute git remote add .

git remote add origin https://<username>@bitbucket.org/<username>/<reponame>

Best video to understand http://www.youtube.com/watch?v=klfLSRXUOzY fyi try to install the Command line console plugin for intellij before viewing the video.

arvindwill
  • 1,960
  • 1
  • 23
  • 39
0

You've to create repo on Bitbucket, then change existing remote repository URL from Intellij Terminal:

> git remote set-url origin https://<username>@bitbucket.org/<owner>/<newrepo>

And push with git push.

loler
  • 2,594
  • 1
  • 20
  • 30