I couldn't find a question that similar to mine but the point I'm asking is where do I run git init
? Do I run it in the src folder where my code is or in the project folder which contain the src folder and a bin folder? I'm working with eclipse and gitBash. Hope this is enough info.

- 1,875
- 1
- 16
- 30

- 126
- 7
-
3You do it in the project folder,so that everything that is needed to build the project is included in the git repository. Things like the builded project you can add to the gitignore file. – ok404 Dec 26 '15 at 23:06
-
What do you mean by builded project? Are you referring to .classpath,.project,.setting and bin folder? – J Scott Anderson Dec 27 '15 at 00:36
2 Answers
What do you mean by builded project? Are you referring to
.classpath
,.project
,.settings
When you create a repo, you need to include anything needed to actually build the project.
That include the src/
folder, but also other configuration files.
Those can include the .project
(if it has only relative paths, easily reused by others), and the .classpath
: see ".classpath
and .project
- check into version control or not?".
The settings/
folder can also be included 5see "Which eclipse files belong under Version Control", but not the .metadata/
subfolder.
It even can include settings for other IDEs like IntelliJ IDEA, if other contributors are using that tool.
It would not include the bin/
folder, typically added in a .gitignore
, because its content is regenerated on demand (built).
Run it in the Project folder.
src folder contains the code files mostly. But supporting resources may be included in the other folders. And you will need to add everything to git without which project may have problem running.

- 2,040
- 14
- 17