Naprav Specif.
Naprav Specif.

Reputation: 63

How do I add an Eclipse java project with EGit to Github?

I have created a repository on Github and have the project in my Eclipse. I also have the Egit plugin and Github plugin. I've looked all over the internet for help on this, but I at last must turn to the Stack Overflow community.

How do I add my java project from eclipse into my repo on Github?

Upvotes: 2

Views: 933

Answers (2)

MithunS
MithunS

Reputation: 485

There are a few tutorials out here on how to import projects from git into eclipse. Though, you can follow these steps:-

  1. Choose the "Git" Perspective, from Window->Perspective->Open Perspective->Other, and then search for Git and select it. This opens the Git repositories view.
  2. From the "Git Repositories" view , choose the option which says "Clone a git repository and add the clone to this view."
  3. Follow the wizard, enter all the details.
  4. Choose the branches you want to import.
  5. Choose the local directory, select clone the sub-modules.
  6. You can choose to import all existing projects by checking the box against "Import all existing eclipse projects", now or you can selectively import projects later. Hit finish.
  7. The git repositories view will now show your repository.
  8. Now you will need to import projects from this repository, only if you havent selected the "Import all existing eclipse projects" box before.
  9. Right click on your repository from the Git Repositories view. Select "Import Projects" option.
  10. Check the radio option, "Import existing Eclipse projects", select the project from your working directory. Click next and then hit Finish.
  11. The Project Explorer should now be showing your project listed there and the name of the branch in square brackets.
  12. Make changes, add files, edit files, once you are ready to make your first commit. Right click on your project under Project Explorer, select Team->Pull.
  13. If this is your first commit, it will say Nothing to update - everything up to date. Hit Ok. Otherwise, it will download the changes, if there are merge conflicts , it will show you those. There are other tutorials which will guide you through dealing with merge conflicts.
  14. Right Click again on your project, select Team->Commit. This opens a Commit Changes window, leave a meaningful commit message.
  15. Select Commit and push.It should ask you for your username and password, you can check the box, which says store these.
  16. Should show Pushed to origin with Message Details. Hit ok, and you are done with your first commit.

Upvotes: 2

cmd
cmd

Reputation: 11841

Select a project. Right click, Team->Share. Select the Git provider. Follow the wizard.

Upvotes: 0

Related Questions