简体   繁体   中英

Put java files in source control (git) when working from eclipse

If I have an eclipse java project and I want to put my source code under control what is the proper way to do it in git?
My source files are under Worspace/ProjectName/src as typically in an eclipse set up.
Should I move the files to another directory where I will do a git init ? Or should I do a git init in Worspace/ProjectName/src ? I am not clear what is the recommended/usual approach.

It's better to do a git init in the workspace directory because eclipse detects the git repo in its workspace(if any) and thereby allows you to manage(index, commit, push, pull, merge, rebase, fetch) your repo through plugin (egit) without even bothering to open the terminal. It definitely gives you a joy and ease of working in IDE.

But still depends how you want to manage your project, there many ways..

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM