To work on a project in Eclipse and push the changes to Bitbucket, you need to have EGit installed. For more info check this link: http://eclipse.org/egit/documentation
To install EGit copy and paste this URL: http://download.eclipse.org/egit/updates
into the ‘
Help > Install New Software...‘ dialog.
Setting up SSH key
Before we import a project into Eclipse, make sure that you have SSH key set up to avoid password prompts when you push code to Bitbucket. See this post for instructions on how to create the key.
Assume you’ve created the SSH key. To load the key into your Bitbucket account follow these steps:
- Open a browser and log into Bitbucket.
- Choose avatar => Manage Account from the application menu.
- Click SSH keys.
- Open a Terminal window from your local machine and run:
$ cat ~/.ssh/id_rsa.pub
Copy the output of that.
- Go back in your browser and click the Add key button.
- Enter a Label for your new key and paste the copied public key into the SSH Key field.
- Click the Add key button.
Clone a Git repository
- Open Eclipse, then Window => Show View => Other…
- Select Git Repositories under Git and click OK.
- In Git Repository explorer click Clone a Git repository.
- Fill out the URI like so: firstname.lastname@example.org:account_name/your_repo.git
account_name – is your Bitbucket account.
your_repo – is the repo you want to clone.
- Check master and click next.
- Leave the Destination Directory as default or change to where ever you like and click Finish.