Push eclipse project to GitHub with EGit

I am successfully pushing my project to GitHub using EGit. My repository is called HelloWorld. My project in eclipse is also called HelloWorld. My problem is when i push the project it is upload the project under the folder HelloWorld. So the result is the repository HelloWorld then the folder HelloWorld and the the src folder. To be more understandable here is the link of the project. I want under the repository HelloWorld to have the src folder. How can I achieve that?

  • Eclipse git and ssh-agent
  • JGit: Status of remote repository
  • Git: Different Working Directory and Repository location
  • How to git merge squash in Eclipse
  • Is .settings/org.eclipse.jdt.core.prefs part of the project?
  • Problems with egit connecting to a git repository on a godaddy shared account
  • How to stash the changes between local repository and remote repository
  • Markdown: Problems with numbered list paragraphs containing code element
  • How to group git repositories by keyword/tag
  • Why do merge conflicts happen?
  • Cross-referencing commits in github
  • How to modify someone else's Github pull request?
  • 2 Solutions collect form web for “Push eclipse project to GitHub with EGit”

    The key lies in when you create the project in eclipse.

    First step, you create the Java project in eclipse. Right click on the project and choose Team > Share>Git.

    In the Configure Git Repository dialog, ensure that you select the option to create the Repository in the parent folder of the project.. enter image description here
    Then you can push to github.

    N.B: Eclipse will give you a warning about putting git repositories in your workspace. So when you create your project, set your project directory outside the default workspace.

    Simple Steps:

    -Open Eclipse.

    • Select Project which you want to push on github->rightclick.
    • select Team->share Project->Git->Create repository->finish.(it will ask to login in Git account(popup).
    • Right click again to Project->Team->commit.
      you are done
    Git Baby is a git and github fan, let's start git clone.