I faced the same issue while migrating my project from github to bitbucket and this is how I resolved it:
Introduction: I will describe the ssh key usage here. A user generates a unique key to connect to remote machines using ssh. So you can create it locally. After, user uploads the keys to the remote machines where want to connect without password and more securely. On Git, the same thing happens, user creates a ssh key and uploads the generated key value to the git system providers like Github or Birbucket. After uploading your unique key, you must configure your development environment to let your git system provider communicate providing security over ssh key.
1) I was using ssh key to push my commits to remote with github in eclipse, the ssh key is set at window -> preferences -> General -> Network Connections -> SSH2
for eclipse (on git pushes, this ssh key is used if set). If you do not have any ssh keys on your machine then follow this article to generate one for you and set it into eclipse at the path above.
2) In your github or bitbucke account, find the screen where you can save your ssh key. For bitbucket, it is at https://bitbucket.org/account/user/[user-name]/ssh-keys/. '[user-name]' here is your user name at bitbucket. Open your 'id_dsa.pub' file (where you generated your ssh key) with a text editor, select all, copy and paste into your github/bitbucket accounts' ssh key addition section and then click add.
3) At eclipse, be sure to use the 'ssh' GIT URI for your project. Go to Window -> Preferences -> Team -> Git -> Configuration
, click 'Repository Settings
' tab and paste your GIT ssh URI to remote.origin.url
.
4) Finally try to push your commits to remote. You mustn't face any errors, if you have please comment under my answer.
Regards...
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…