Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't push using EGit and Bitbucket

I've been trying to start a project using EGit with Bitbucket but I can't push the project to the repository in the server.

These are the steps I've followed (I'll try to be very specific so other people can use it as a tutorial mode; even though it's not working for me it might work for others):

1) I installed Git on Ubuntu 12.10 using this tutorial

2) Followed this tutorial for GitHub.

  • Start a new C++ project in Eclipse
  • Under Window > Preferences > General > Network Connection > SSH2 > Key Management tab, I generated a new RSA key and added it to the list of deployment keys of my repository on Bitbucket.
  • Right click on the eclipse project: Team > Share project ; Team > Add to index ; Team > Commit
  • Window > Show View > Other > Git > Git Repositories
  • Right click on Remotes > Create Remote > Checked "Configure push" and typed my project's name
  • Add Push URL: ssh://[email protected]/myuser/myrepository.git, Protocol: ssh; port: blank; user: git; password: blank
  • Advanced button under Ref mappings and selected the "master" version. If this step works, it means that the RSA key is configured in Bitbucket and EGit properly. Otherwise it will show a connection error.

Everything is done. However, when I press "Push" I get the following error:

ssh://[email protected]/myuser/myrepository.git: push not permitted

I've tried every configuration possible: switched to a new work space, updated Eclipse, created new repositories, re-installed Git... Any ideas?

like image 731
EmilioSG Avatar asked Nov 20 '12 20:11

EmilioSG


People also ask

How do I clone and push to Bitbucket?

Windows Command Prompt From Bitbucket, go to your BitbucketStationLocations repository. Select the Clone button in the upper-right corner. Bitbucket displays the Clone this repository dialog. By default, the clone dialog sets the protocol to HTTPS or SSH, depending on your settings.


2 Answers

Alright, I've finally found a way to work with it.

It's just changing the authentication mode. If the HTTPS link is used, instead of using the SSH link, everything works perfectly. It seems that SSH works just in a read-only mode.

SSH/HTTPS selection

Of course the authentication method is different: you have to type the password and the SSH keys stored in Bitbucket are no longer necessary.

For those who are having problems with EGit, I recommend following eugener's way to automatically configure EGit. Then you just have to select HTTPS as authentication mode to push the stored commits.

like image 100
EmilioSG Avatar answered Oct 19 '22 06:10

EmilioSG


There is much simpler way of configuring remote Git repos in Eclipse:

  1. Create an empty repo on BitBicket
  2. Copy repo's URL
  3. Clone repo to your machine using "Git Repositories" view.
  4. Share your project into newly cloned repo.

Since a repo was cloned - remote settings were configured automatically. This means you will be able to push immediately

like image 33
Eugene Ryzhikov Avatar answered Oct 19 '22 06:10

Eugene Ryzhikov