If you do not need an additional directory level in the git repository, you need to enable the option โUse or create a repository in the projectโs parent folderโ at the very top of the โConfiguring the git repository dialog (Team โ Share Project ... โ Git).
However, this will create a repository directly in your workspace, and not in the default repository folder, which is not recommended. But you can move the project to the right place and re-import it into the workspace in the second step.

Another option is to first create a repository on github. After that, you can clone the github repository and move your code into it.
Stefan ferstl
source share