I am planning for Enterprise JavaBeans Developer (1z0-895) certification & for this certification preparation I am setting up a public repository on GitHub. Hopefully I will be sharing my preparation in the coming posts. This time I will share how to configure eclipse to connect to the repository on GitHub.
If you don’t have account on GitHub you need to create one. Its really simple and free. I created a public repository with the name “OCEJBCD-1Z0-895”. In rest of the steps you will be configuring eclipse to connect with the created repository.
First check if you have EGit plugin installed in eclipse by going to Help > Eclipse MarketPlace
Search for egit. Once search results appear you can install the plugin if it is not already installed. In my case it is already installed. If you are installing it for the very first time you will have to accept the license and agreement and eclipse IDE restart will be required afterwards.
Cloning of the repository can be done in 2 ways either HTTPS or SSH. I will be demonstrating clone with HTTPS. For this you need https url. In GitHub user interface after you have created repository, click on the Clone or download drop down as shown below and copy the url for further use in eclipse.
Once you have url, in eclipse Open Git perspective by going to Window > Perspective > Open Perspective > Other
Select Git as shown
Select Protocol to be https and paste the url earlier copied in URI. Put username and password in authentication section. Check “Store in Secure Store” so that you will not be prompted with username password time and again. Click Next
Select the folder where you want local repository (replica of remote repository on local drive) and click Finish
After clicking OK, a prompt will appear to alert you if you require password hint. Click No if you don’t require or yes, in case you want some hints to recover back you password when forgetting it completely
You can verify it also by exploring the README.md file in your local storageFor test purpose we will edit this readme file in eclipse Git perspective and commit it as well. Locate and open this readme file
Next you need to index this file for commit
Type some Commit Message. Next you can Commit (commits into local repository, further push is required to remote repository) or Commit and Push (commits to local repository and pushes the change to remote repository as well). I will perform Commit and Push here
You may be prompted for the branch. Once file is committed and pushed to remote repository, you can verify the change in GitHub user interface.
Hope you find it helpful :).