Create a local repository and Upload a local project to GitHub by using Eclipse
Tools
1. Eclipse Oxigen
2. GitHub https://github.com/
Create a repository
1. Open an GitHub account in this
address https://github.com/
2. Confirm and log in
3. Go to your home page
4. Click on new repository
5. Selected owner is by default your
profile.
6. Type a name for your repository
7. Set a description of your repository
8. Select the privacy level of your
repository by default is public which it means everybody would see your
repository and projects
9. Check the initialize this repository
with a README box
10. Create repository. This action will
send you to your repository
11. Click on Clone or download button
and copy the address in the box
Now turn back to eclipse
1. In the project explorer right click
on your project ->Team-> share project
2. A dialog will open you need to
create a local repository to upload to your git
3. Click on create, set a name to your
repository and finish. Be sure stop all servers and services that might be
using your project before to share it.
4. Your project will see like the image
below. This means you don’t have any branch associated to your project
5. Right click on your project->Team->Commit
and you will see a commit panel like the image below
6. Drag all the files located in
Unstaged Changes to Staged Changes
7. Click on commit
8. Now right click on your project
-> Team -> Remote -> Push
9. Set the address that you copied in
previous steps, set your user and password which are the same as your account
on git hub. Click on next
10. In the next window, set the source
ref which is your local project Ctrl + space opens the possible reference,
choose master. In the same way set the destination ref which is the remote
repository on git hub
11. Click on Add spec, then check force
to update box and click next and finish.
12. If you get a non-fast forward you need
to rebase the project. Right click on your project -> team -> rebase. A
window will open. All the information is set you just click on reset
13. Try to push again and Check the
force update box, click on next and click on finish
14. You will get a message like the
image below
15. Check your project on GitHub
Thanks for
reading