How to initialize git for a new eclipse (neon) java project
I installed a fresh copy of eclipse Neon, and created a new gradle java project in a new and shiny workspace. What is the best practice for adding git to the party?
I read that initializing git in the project directory is really a bad idea.
What is a particularly good idea then?!
The good idea is to git init a parent folder of the project different from the main workspace folder.
This is exactly what happens if you let Egit git init your project (Right click on project -> Team -> Share Project -> Git ->…) and select an external folder as repository, say c:usersjohnmy-git-repository.
You will then have two folders:
Another option is to create a folder inside the workspace, create the project as a subfolder of that folder and then git init that folder. This way:
You will create the repository in the
Remember why Eclipse suggests to keep repositories outside the workspace (https://wiki.eclipse.org/EGit/User_Guide#Creating_Repositories):
If your git repo is in the