You can follow this user guide section of git push (to a GitHub repo), adding a remote with the ssh address of your GitHub repo:

See also this tutorial to push your local project to that GitHub repo.
Answer from VonC on Stack ExchangeYou can follow this user guide section of git push (to a GitHub repo), adding a remote with the ssh address of your GitHub repo:

See also this tutorial to push your local project to that GitHub repo.
- Go to github create new repository
- Copy http URL from github
- Go to Eclipse --> Right click on project --> Team--> share project--> Create new Git Repo.
- Go to Git Staging--> add to index --> commit and push
- Right click on Git Repositories push to up stream
- Paste your http URL of githun which you copy in step 2
- Enter username and password of github -- > Finish
Videos
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.
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
I am not expert but i have done this once
think simple and straight way is
1.Download Git to your system
2.cd to your eclipse prject cd /workspace/sampleproject
3.Commands
git config --global user.name "Your Name Here"
git config --global user.email "[email protected]"
touch README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/gitusername/reposname.git
git push -u origin master this line may throw an error but no problem
4.From eclipse ->Help->eclipse marketplace ->search for 'git' -> install 'Egit-git team provider'
5.Go to eclipse ->Windows ->Open perspective ->Git repository
6.From Git repository view on the left side on 'Add existing local repos' then browse to '/workspace/sampleproject'
7.Now Right click on this added Repository location and add comments press Commit.
8.Now Right click on this added Repository click Push
By default Configured remote repository should be checked then press Next
From Source Ref and Destination Ref Select HEAD //you may change if u want
Select next give your github username and password then click on Finish.
If you are using the https address, you need to pass your credential (Github login and password).
See "Syncing with github" for an example.
With Eclipse and Egit, you can set those credential when defining a remote address for your local repo.
See "Push upstream".
