Why can't I add a local GitHub repository into Eclipse? - eclipse

There's this project that has been discontinued that I want to have in my Eclipse workspace so that I can maintain it for my own personal use (the author of the project is fine with this). I have the repository from GitHub downloaded and am trying to import it into Eclipse using this tutorial: https://github.com/collab-uniba/socialcde4eclipse/wiki/How-to-import-a-GitHub-project-into-Eclipse.
After defining the directory of the local repository and clicking "Next", I'm presented with this: Error message
Any ideas on what I could be doing wrong?

Related

Repository created on GitHub cannot be used a NetBeans project

I have created a repository on GitHub (site/server) and have managed to clone it on my development PC using GitHub Desktop. However, if I try to use the same repository directory in Netbeans IDE (v12.6), I fail to do so because NB only allows to Create a "new [NB] project" or open an "existing [NB] project". But the repository is clearly not an NB project.
I am looking for a solution to make the repository into a NB project as well.
Any help would be greatly appreciated.
Sangham

Imported repo does not import the projects within

the title says most of it. I also checked the "Import all existing Eclipse projects after clone finishes". I am starting to learn github. Please help me and make this a pleasent start so I actually keep using it. The repo folder that I had to choose for the repo is not in my eclipse workspace. I thought I don't need to manually import the projects in the repo if I check that checkbox. I use eclipse Mars and EGit.
Edit: I created a new repository before on GitHub. I imported a test project into my repository to play around with it and test stuff. Thats all whats in the repository.
Thats what my GitHub repo looks like on the website:
Apprecciate your help.
Eclipse will only import Eclipse projects. So if you have some plain Java projects (without Eclipse specific meta data) or even just plain folders in your repository, those will not be imported. However, you can import all such non Eclipse artifacts into Eclipse projects by using the "Import -> General" wizard category.
And in case your projects are Eclipse projects, you can re-try the import from the locally cloned repository into your workspace by using the "Import projects" menu on the repository in the repository view of Eclipse.

How to point github project at Eclipse

I have cloned a github repository and would now like to import the project into Eclipse.
The project name is 'myproject' and when cloned it is then created in my github repository :
c:\\users\\myrepo
Here are the files that were cloned :
The repository exists in a location which is different to the Eclipse workspace. How can I use this project within an Eclipse workspace ?
I'm going to answer this question as I found an answer while writing this.
Within Eclipse create a new project and set its type to the project type, in below example Scala :
Click next and on new dialog enter path to project location on local git directory :
Verify project setup is correct and click 'Finish'. The project should then be added to Eclipse and any changes made will be reflected in the git repository and so will be recognized by 'github for windows'
See http://wiki.eclipse.org/EGit/User_Guide#Starting_the_import_wizard and follow the path of Adding the clone you've already made.

not able to import github project in eclipse

just created project on github from my office and when then i came home and was trying to import the project on my home machine but I am not able to do it.
Following is the detail.
Both home and office machine has eclipse Juno and Egit plugin installed. I am able to do check-in from office. but at home I am not even able to import the project.
my workspace directory - c:\gaurang
git local directory - d:\Gaurang\Webdriver-Data-Driven-Framework
Now if i choose "Import existing projects" it says No project found
if i choose "Use the new Project Wizard" - it creates empty project
if i choose "Import as general project" - it creates the project but not a java project so not able to compile or run.
My git repository - https://github.com/Gaurang033/Webdriver-Data-Driven-Framework.git
I struggled in a similar fashion when checking out https://github.com/angular/angular-seed.git
The problem was that I expected to happen in a single step. The Github project does not contain eclipse files, so of course you can not import existing projects - the other options should work, however and they don't
The solution for me was to:
Clone the github repository locally e.g. /home/name/git/angular-seed (import.../Projects from Git/URI)
Obtain a working copy as a plain project (import.../Projects from Git/local)
I think it's a bug
The result is that I have the cloned repository in /home/name/git/angular-seed and a skeleton project with a ".project" file that points to that place
You have to push your .project and .classpath files to the repository if you want to be able to import the project using the "Import existing projects" wizard. If those are not present, eclipse cannot detect an existing java project.

Importing with EGit clones repository but doesn't let me import project

I just started my third repository on Github. I initialized the repository on the website with a README file and tried importing it into Eclipse with Egit. Like my other projects from Github, the import dialog worked fine and the repository was cloned. In my file explorer, I can see the folder Egit created, as well as the .git folder and the README from the repository.
However, when I get to the point where Eclipse wants me to choose a wizard for project import, everything stops working. I can't import an existing project, because none exists yet. If I try to import it as a general project, it doesn't let me go further because it claims:
/path/to/my/folder overlaps the location of another project: 'gnu_magic'
This is indeed the name of the project I'm trying to import, but as I just imported it for the first time that shouldn't be a problem.
If I use the new project wizard, it doesn't let me use the same folder name as the project, claiming that the folder is not empty (which is true, but strange when I'm using the wizard to create an entirely new project). If I give the folder another name, it creates a project but the project isn't connected to the repository - I have no way of committing my changes back to Github.
Deleting the gnu_magic folder and starting all over again brings the same results.
Is there a way to remove the metadata over that specific project from Eclipse's configuration? I don't want to lose my other projects but I would like to work with Egit on that project.
Another interesting fact: If I clone the repository manually and then try to import it into Eclipse, as a project from my file system, it doesn't let me becasue the source is in the heirarchy of the destination.
Or am I missing the point here completely? I'm just surprised that I was able to clone the other repositories without any problems. Working with them over the past few days has been quite easy.
The solution was a bit strange. Here's the steps to solve it:
Clone repository using EGit
Eclipse refuses to import project, claiming it already exists. Exit import dialog.
Create new project using existing code, using cloned repository
Share project with old repository
Now the project is once again connected to the repository. Be careful with this method because if something goes wrong you might commit over your old code. This solution works with Indigo and Juno.
I'm using Eclipse 4.2 Indigo, and I've been struggling with these same problems for a while now.
If you have already cloned a repository on your machine somewhere, using EGit or whatever, you can:
1) Create a new Eclipse project.
2) File -> Import -> General -> File System Choose the cloned repository location. This will import everything, including the .git folder within the repository, into your Eclipse project in your workspace. For this it doesn't matter whether there's .project files anywhere in the imported files or not.
3) Team -> Share Project -> Git The EGit plugin should detect the .git folder within your project and suggest settings accordingly. You will have a new local repository location addded to EGit's repositories which will point to the .git folder under your project's directory.