Create your Java project as usual in Eclipse, do your work, add files, etc. When you are ready to push to GitHub, take the following steps:
- create a repository with the appropriate name in your GitHub account (do not initialize it with a README)
Then from Git Bash (remember to do git status
often -- it will tell you what's going on!):
- navigate to your project folder (if it is in the default location, the command would be
cd default-workspace/<project-name>
, where<project-name>
is the name of your Eclipse project) - initialize your repository with the
git init
command - add your files to staging using
git add
, where `` is the file or folder you would like to add. Here are some examples: