Home » Certification » Java Certification » 1z0-895 » OCEJBCD -1. GitHub repository clone in Eclipse using eGit

OCEJBCD -1. GitHub repository clone in Eclipse using eGit

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

git01_2016062211:41:18_Workspace 1Search 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.

git01_2016062409:03:34_Eclipse MarketplaceCloning 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

git01_2016062409:36:57_Open Perspective


After Git perspective is displayed. Click on “Clone a Git repository”git01_2016062409:41:49_Selection

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

git01_2016062509:03:50_Clone Git Repository

We created just a repository and no other branch, so by default we have master branch, let it be selected and click Nextgit01_2016062509:04:06_Clone Git Repository

Select the folder where you want local repository (replica of remote repository on local drive) and click Finish

git01_2016062509:05:22_Clone Git Repository

Cloning will be in progress but meanwhile you can be asked for master password for secure storage if you did not already setup. Choose your passwordgit01_2016062509:34:57_Selection

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 completelygit01_2016062509:35:36_Secure Storage - Password Hint Needed

git01_2016062509:36:03_Password Recovery

Upon completing it successfully you can see repository in Git Perspectivegit01_2016062509:43:19_Selection

You can verify it also by exploring the README.md file in your local storagegit01_2016062512:06:32_OCEJBCD-1Z0-895For test purpose we will edit this readme file in eclipse Git perspective and commit it as well. Locate and open this readme file

git01_2016062512:20:10_Selectionmake some changes in it. I added second line “test commit”. It can be observed in Git Staging view that this file is yet to be committed in local repository and need to be pushed in remote repository

git01_2016062512:22:10_ejbworkspace - Git - -mnt-Drives-D-Java-ejbwildfly_training-git-OCEJBCD-1Z0-895-README.md - Eclipse

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 :).


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s