Reputation: 380
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.
ssh://[email protected]/myuser/myrepository.git
, Protocol: ssh; port: blank; user: git; password: blankEverything 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?
Upvotes: 11
Views: 17316
Reputation: 758
Using Bitbucket I do it this way:
Upvotes: 0
Reputation: 6930
In this specific case I agree with resolution from Olivier J.'s comment under original question.
But I have had similar problem and it was caused by something else. I resolved it and here is what happened:
I have been using some private repository at Bitbucket (A) with some user account and some public key (X) to access it. I have had key X loaded in my pageant
Putty key chain.
Then I created a new public repository (B), also at Bitbucket with a different user account and another public key (Y). I added this key to pageant
too.
When I tried to access repository B apparently public key X and not Y was used, because ..for SSH client both connections are the same - same user (git) at the same host (bitbucket.org)! And key X was used first because ..it was loaded earier? Or maybe because its name was alphabetically first? I am not sure but the result was that...
Read-only access for B using X was granted because the repository was public and any valid Bitbucket user key was enough to gain this kind of access!
..but writing (pushing) required key Y, which was not used by SSH.
So the general tip is: to resolve strange read-only git via SSH access errors check carefully which private key is actually used by SSH.
I resolved this problem by loading only one key - X or Y - in pageant
at a time but I would love to do it a smarter way - please let me know in comments if you know how!
Upvotes: 0
Reputation: 84
Probably related, I fixed "auth fail" problems by following the instructions on: http://wangpidong.blogspot.com.es/2012/05/how-to-use-bitbucket-with-egit-in.html
Got it from: Configuring egit with BitBucket
Upvotes: 0
Reputation: 380
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.
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.
Upvotes: 11
Reputation: 17359
There is much simpler way
of configuring remote Git repos in Eclipse:
Since a repo was cloned - remote settings were configured automatically. This means you will be able to push immediately
Upvotes: 3
Reputation: 5693
It might be a user name misconfiguration in .gitconfig.
Upvotes: 0