How to share eclipse project to github and viceversa

In this tutorial, let us  see how to share any eclipse project to Git repository ( and also we will see how to  to check out  the github repository  project in Eclipse.

In this example, let us share the project named JavaRestService to git and vice versa.

PART I) Steps to share eclipse project to Github repository.

1. Create a new local git repository or use an  existing one and share the project.  For creating local git repository, right click on the project and select Team->Share Project->Git



2. Select any local folder (in this example, C:\GitRepos\JavaRestService) as Repository to store the project and click on Finish


Please ensure that the folder C:\GitRepos\JavaRestService is created

3. Click on Next and Finish.


4. Commit the project.  For committing the project, right click on the project and select Team->Commit



Select all the files to be committed and Click on Commit.

Now the project is committed to the local git repository.

5.  Now Push the local git  repository to Right  click on the project and Select Team->Remote->Push


Assume that you have created new remote repository (In our example, JavaRestService)  in If you have not created, new remote repository, then follow the steps given in the Part II.

6. Paste the remote git repository URL in the URL input box and give userid and password then select next. In our example, we are using https protocol.


7. Select source and destination reference (refs/heads/master) as given in the image and click on Add Spec then Next and Finish


8. Confirm the push


now you have successfully  pushed the local repository to remote


Part II) Creating new remote repository in
  1. Login to


2. Click on Create Repository and enter new repository name (In our example: JavaRestService)



3. Confirm the button Create Repository

Now the remote empty repository is created and the  URL for the repository is


PART III) Checking out the github shared project in Eclipse
  1. Right click on Eclipse work space and select Import->Import->Git->Projects from Gitgithub importgithub import1
  2. Select Clone URI and Next

github import2

github eclipse import3

3.  Paste the shared repository url  in the URI  input box(In our example,, fill the user id and password then Next

github eclipse import4

4. Select Branch and Next

github eclipse import5

5. Select local destination directory where the local git repository needs to be created

github eclipse import6

6. Select Next

github eclipse import7

7. Again Select Next and Finish. Now the remote git project is imported and   github repository is created locally.

Leave a Reply