Importing git project into workspace without using egit
I asked a question a relating to Egit a few weeks ago & it was suggested that I read pro git, which I have been referencing. I'd rather use git from the command line and wait for egit's stable release with the Eclipse Indigo release in June, because there are to many bugs and it tends to make my ide stall.
So to try it out I copied my working directory to a new location created a git repo & init then added all the files in the working directory. My thought was I could control all the git functions from the command line, then use F5 -refresh in eclipse so that any git operations would be reflected in the project.
Firstly I'm not sure if this is a good way to go about it...there's still alot about git, eclipse & egit I don't fully understand.
But my major stumbling block at the moment is I'm not sure how to get the files from the working directory I copied into a project in eclipse, I've looked at ava开发者_如何学Goilable import options & tried a few & the results don't look anything like the project I ended up with using egit > Import projects from git. When I used 'Import projects from git' all the hundreds of src folders, jars & other resources showed up in the correct place.
I relize this may be a dumb question, I learn things on a need to know basis. There are many holes in my knowledge of eclipse.
Any help, insight or direction would be much appreciated.
So to try it out I copied my working directory to a new location created a git repo & init then added all the files in the working directory.
You shouldn't have to copy anything. If you've already got a git repo you can just clone it into Eclipse's workspace. If you've got the code in an Eclipse project you can just do a git init
in the project directory.
My thought was I could control all the git functions from the command line, then use F5 -refresh in eclipse so that any git operations would be reflected in the project.
Yes, that is a valid workflow. I've got my repository in Eclipse's workspace. After a git operation I simply use F5 to refresh the files in Eclipse. If, in the future, you do want to use egit you can simply point it at the existing repository at that time.
I've looked at available import options & tried a few & the results don't look anything like the project I ended up with using egit > Import projects from git. When I used 'Import projects from git' all the hundreds of src folders, jars & other resources showed up in the correct place.
As for importing, I assume you already have a .project file in your repository because jars and resources are handled automatically when importing from egit. You should import, using the existing .project file. Go to File -> Import -> 'Existing Projects into Workspace'. Point it towards your checked out repo and it will work fine.
精彩评论