I wish to import an existing CVS managed project into Eclipse. I am currently trying to shift my work on to the Eclipse IDE. Some details about my project and environment below.
I'm working in Linux Ubuntu, the project folder is located on a mounted shared network drive, I have installed the "Eclipse CVS Client" plug-in for my version of Eclipse (Helios).
I've tried many ways for eclipse to use my existing folder as a project and recognize the CVS data in the CVS folders.
I have done the following options:
Created a new project, selected existing source, located my project folder and clicked OK to finish creating. In the end the CVS files weren't automatically read.
Did the same as above and after project creation I wen to the option "project menu->team->share project", it asks me to choose a repository and doesn't automatically find the CVS information in the subfolders.
I have set-up both repositories in my eclipse and can browse the repositories through the CVS browser.
My project directory layout is like this:
+-Project Folder (no CVS folder at this level)
+---Repo A folder
+-----CVS meta-info folder is INSIDE, along with all checked out files from Repo A
+
+---Repo B folder
+-----CVS meta-info folder is INSIDE, along with all checked out files from Repo B
+
+-(couple of random files, not in CVS)
Just right-click on your project and click Team -> Share Project. Eclipse will detect that the folder is already shared and resolve the connection with CVS.
Actually I cannot answer your question (I think it should work as you explaned) but I might have a workaround. Could you remove or rename the existing folder and do a fresh check out from your eclipse/CVS repository exploring view?
Related
So, here in the company we work with svn, and our svn server only have the source folder. When I use NetBeans, it's everything ok because I can add source folders in project and will work fine in svn. But on eclipse if i do the checkout from command line and add that folder in my dynamic web project, I can't see the svn history and nothing, svnclipse just does not work on that folder.
Our structure of the projects it's something like this
Workspace
Project folder
Project1
Project configuration files
SourceCode
Packages
Project folder 2
Project2
SourceCode
I already try to make checkout using svnclipse, but he add alot of extra config files, he turns the folder in a project and the source folder is add as a link to another project, in this scenario the svnclipse quick diff does not work properly.
There is a way to use that folder as source and Svnclipse works on that ?
Sorry if my English is not so good
There is no easy way to do what you want. In Eclipse a source control provider can only be connected to the project itself. So options are:
Use another svn client like command line or TortoiseSVN.
Create a small SVN project with the Eclipse project configuration files that also use svn:externals to pull in your source folder from repository.
With option 2, you would checkout this small SVN project from some other repository using Subclipse in Eclipse, could even be a local file:// repository and then the svn:externals property would also cause your source folder to be checked out.
In Eclipse Oxygen, I created a project called testproj at c:\jwork2019\testproj\. My workspace is at c:\jwork2019\. The project's folder has the content of
c:\jwork2019\testproj\.settings\
c:\jwork2019\testproj\src\
c:\jwork2019\testproj\.project
I would like to create a git repo for the project, located at a separate repo directory at c:\jrepo2019\. I successfully created the empty repo c:\jrepo2019\testproj\.git\. I want it to track all the project's files located at the workspace at c:\jwork2019\testproj\*.
I have successfully created the project and the empty repo via Eclipse and Egit.
The problem is when I tried to Configure Git Repository of the project by right-clicking on the project and then Team -> Share Project..., I could select the repository created, but it changes/moves the project's folder location from my workspace at c:\jwork2019\testproj\ to c:\jrepo2019\testproj\testproj\.
I would like the project workspace directory stays in c:\jwork2019 instead of moving the project directory to the repository folder c:\jrepo2019\....
I am guessing that I can do that via git command line by just git add c:\jworks2019\testproj\*, but I don't think I have the git command line installed, I only have git on Eclipse.
I found the question Can I store the .git folder outside the files I want tracked? that has the same goal. But it does it on linux command line.
Is this achievable in eclipse? And how can I do what I wanna do? Thanks
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?!
Thanks!
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:\users\john\my-git-repository.
You will then have two folders:
c:\users\john\my-git-repository containing the \.git folder and \<my-project> folder
c:\users\john\<eclipse-workspace> the eclipse workspace folder, which will NOT contain your project folder (remember that eclipse workspace is just a logical container for projects, they don't need to be physically there).
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:
c:\users\john\<eclipse-workspace>\shared-projects\<my-project>
You will create the repository in the \shared-projects folder (either by command line with git init or from whithin Eclipse with the wizard), which will contain the \.git folder, \<my-project> folder and any other project you want to share.
Remember why Eclipse suggests to keep repositories outside the workspace (https://wiki.eclipse.org/EGit/User_Guide#Creating_Repositories):
It is a good idea to keep your Repository outside of your Eclipse Workspace.
There are several reasons for this:
The new Repository will consider the complete folder structure of the Eclipse workspace as (potential) content. This can result in performance issues, for example when calculating the changes before committing (which will scan the complete .metadata folder, for example)
If your git repo is in the \shared-projects folder the repository will NOT consider the complete folder structure of the Eclipse workspace as (potential) content and will NOT scan the .metadata folder since it's outside the repo. The only contents of the repo will be your shared projects!
when I am trying to share my project with git repository getting exception like this
"Target location for project " " already exists, can not move project"
Writing an answer because I tried many options suggested in many similar questions but none worked. Then I did it manually with following steps that worked, and these steps will work for any Eclipse version:
Goto the Eclipse workspace in the file system and copy the project from there and paste it in some other location in your file system. This will serve as a backup.
Goto your Eclipse and then right click on the project and click delete. You can say delete from the file system because you've already taken a backup in step1.
Goto your Git repo in the file system and paste the project folder at the location you want (may be inside another folder with .project file doesn't matter).
Then come back to your Eclipse and then File->Import -> Import from Git -> Local repo -> Select the Git local repo where you've pasted the project in step 3 and then import it as usual.
As I said earlier, this will work for any Eclipse version.
This situation will happen if you already have a Project of the same name in your local git repository. Sharing a project means steps to commit your project into your local git repository and from there it as ORIGIN will be pushed to Master (Remote). (You are creating again with a new eclipse IDE, or that project was deleted from IDE but committed to local repository in the past).
Solution is simple:
Remove the project from your local git repository.
C:\Users\username\git on windows operating system. (If this not possible then next step)
Rename the project in your IDE (Better recreate a project with same code but with new Project name) that you want to share: repeat the process of sharing on Eclipse IDE.
You may optionally want to recreate after dropping the remote repository(master), if something is already pushed from last push of project, so that everything is clean. You may visit the git repository to confirm it.
In my case this was caused by an extraneous .project and related Eclipse files at the top of the git repository folder. The files were created by Eclipse due to incorrect folder specified on Import of the other projects in the repo.
I have a Subversion repository I have checked out and have in my local hard disk. Now, how do I import this into Eclipse?
When I choose File > Import and choose SVN, there is only an option to checkout a project from the server again. File > New project seems to be for projects we are creating new projects from scratch.
"Import..." the existing project then "Share..." the project. The Subversive (or SubClipse) client will realize that the project has a .svn folder and reattach to the repository.
In Eclipse click on:
File -> Import -> General -> Existing Projects into Workspace
However you have to define a workspace location being different from the one that is being checked out in order to prevent yourself from changes to the checked out repository.
I've tried with File->Import Projects from File System or Archive, and in the blank space of Import source, you just need to browse through button Directory.. and find the project path you wanted to import. Then the svn connection is automatically detected.
Install the subversive plugin from market place or from update site.
Use appropriate SVN connectors during setup Windows->Preferances->Team->SVN->SVNConnectors. SVNKit 1.8.11 worked for me.
Make sure Enable automatic project share checkbox is set at this location Windows->Preferances->Team->SVN->General
Just import the existing SVN project File->Import->General->Existing Projects into Workspace, then eclipse will automatically recognize it based on the .svn hidden folder. Need not explicitly do Team->Share project.