Push eclipse project to GitHub with EGit
Solution 1
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.. 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.
Solution 2
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
Solution 3
I use these Simple Steps when I already have committed locally a new project:
- Open github.com and sign in and create a new repository.
- Copy URL of the new repository.
- Open Eclipse.
- Select Project which you want to push on github->rightclick.
- select Team->share Project->Git-> "push branch '' ...".
- Follow the wizard until it finishes.
Related videos on Youtube
salvador
Updated on July 09, 2022Comments
-
salvador almost 2 years
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?
-
Ashok Pandian over 7 years@KumarAbishek, To get URI, go to your GitHub account, open the corresponding repository and copy the current page url. Once you paste the url in URI field, other fields such as Host, Repository path and Protocol will be auto populated.
-
-
2Big2BeSmall over 8 yearsHey, i have created a project and shared it with Team > Share>Git. but how can i add new class which added after share with git? how do i update the project on git with this new class ?
-
greenkode over 8 yearsI would suggest you spend some time familiarizing yourself with Git. Here's the Egit User guide, it contains everything you need to know when using Egit from within eclipse. wiki.eclipse.org/EGit/User_Guide
-
TmTron over 7 yearssee also: stackoverflow.com/questions/17552457/…
-
Kumar Abhishek over 7 yearsSatya, Please also mention how to provide URI, Host,Repository path. the one that you are suggesting only works when git project is already configured.
-
Al G Johnston about 4 yearsDoes this take care of dependencies on other projects in the workspace? What would be the best way to handle dependencies? I am trying to get my stuff on Maven to make it easier, but it is slow.