我有一个git repo,里面有很多测试脚本。我开始将此repo设置为我的"工作区"在eclipse中,我可以直接使用eclipse进行更改,然后在完成后将它们推送到bitbucket。
Eclipse不会让我这样做,我无法在工作空间中看到任何内容,当我尝试将本地仓库导入工作区时,它告诉我"无法从现有工作区文件夹导入项目MavenTest& #34;这对我来说没有意义,因为我必须从我的仓库中创建一个单独的工作区,然后将工作放入工作区并手动将其复制到本地仓库,然后将其推送到bitbucket。由于我必须将任何更改复制到我的工作区,因此将所有内容都拉下来也会很痛苦。我打败了版本控制的整个目的。
有人可以向我解释我做错了什么吗?我只想在同一个目录中工作,推送和拉取所有内容。
答案 0 :(得分:1)
Eclipse expects everything at the top level of its workspace directory to be a project, or otherwise content written by a plug-in through Eclipse's APIs. Any other content in the repository will be unusable and not importable as its location already overlaps the location of the workspace.
I would have to make a separate workspace from my repo and then do the work into the workspace and manually copy it to the local repo and then push it up to bitbucket.
Wrong. You're under the misconception that everything shown in the workspace has to physically live under the workspace directory, which is very untrue. They don't have to be there, they don't even have to be physical files.
Typically you will make Eclipse aware of the local clone using its Git Repositories
View, and then use the view's context menus to import content from the repository's working directory as projects in the workspace (or using a Maven wizard provided through M2E). This import will not duplicate anything. You will still have one canonical location for your sources: your repository.
https://wiki.eclipse.org/EGit/User_Guide#Creating_Repositories