If you have an existing eclipse project that you want to push to an existing newly created repo on github, these are the steps:
1) Go to the eclipse project folder path in cmd prompt
2) git init
3) git add .
4) git commit -m "First Commit"
5) git remote add origin https://github.com/shamsa-abid/MyUPMiner.git
6) git pull origin master --allow-unrelated-histories(optional step)
7) git push -u origin master
However, it is recommended that you first create the repo on Github, clone it to a folder and create your eclipse project in that folder.
Solution for error: fatal: refusing to merge unrelated histories is step no. 6
1) Go to the eclipse project folder path in cmd prompt
2) git init
3) git add .
4) git commit -m "First Commit"
5) git remote add origin https://github.com/shamsa-abid/MyUPMiner.git
6) git pull origin master --allow-unrelated-histories(optional step)
7) git push -u origin master
However, it is recommended that you first create the repo on Github, clone it to a folder and create your eclipse project in that folder.
Solution for error: fatal: refusing to merge unrelated histories is step no. 6