Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit / JGit » Searching a git project(Setting up a working set for searches)
Searching a git project [message #894543] Mon, 09 July 2012 14:41 Go to next message
Bruce Sherwood is currently offline Bruce SherwoodFriend
Messages: 5
Registered: July 2012
Junior Member
I've used Eclipse for many years but egit is new to me. I can clone the relevant remote git repository, but I suspect I've gotten totally crosswise of the distinction between repository and project, and/or I don't know which buttons to press or boxes to check during the cloning process. I've started over from scratch several times and tried many combinations but I'm always left with a situation where my files show up only in the view "Git Repositories", not as a project. Attempts after the cloning to do an import give me messages that I can't import because it's already imported.

In particular, I have no way to search for strings in my files, because I can't find any way to set up a working set for searches through these files. Help?
Re: Searching a git project [message #894908 is a reply to message #894543] Wed, 11 July 2012 03:47 Go to previous messageGo to next message
Bruce Sherwood is currently offline Bruce SherwoodFriend
Messages: 5
Registered: July 2012
Junior Member
There have been nearly a thousand views of my plea for help, but no responses, so I'll try a different set of questions. Does anyone reading this forum ever search successfully through all of their egit files for a particular string? If so, exactly what menu item do you choose from the Search menu, and exactly where do you enter the search string in the dialog box that appears? Are you in the "Git Repository Exploring Perspective" when you do the search? Is there some other perspective I should be using? Do you see your files in some perspective other than in the "Git Repository Exploring Perspective"? Thanks.

Signed,

Desperate
Re: Searching a git project [message #895008 is a reply to message #894908] Wed, 11 July 2012 11:43 Go to previous messageGo to next message
R Shapiro is currently offline R ShapiroFriend
Messages: 386
Registered: June 2011
Senior Member
Egit is not involved with searching at all, except for the special case of searching for Git commits ("Git Search"). Any other kind of search works just like always: it will search the Eclipse projects in your workspace. It doesn't matter which perspective is visible, that has no effect on what gets searched. Usually I find it more convenient to do searches in the primary development perspective (Java, CDT, PyDev, whatever), but you don't have to.
Re: Searching a git project [message #895201 is a reply to message #895008] Thu, 12 July 2012 03:07 Go to previous messageGo to next message
Bruce Sherwood is currently offline Bruce SherwoodFriend
Messages: 5
Registered: July 2012
Junior Member
Maybe I'm using the wrong vocabulary to describe my serious problem, so I'll try rephrasing it. I'm surely missing something simple, but it's preventing me from working. I understand that the view shouldn't affect searches but couldn't help wondering about it due to the following:

In the case of CVS I have two views: the CVS repository view and the C/C++ view. Only the latter shows up in "Project Explorer" or in the list when I want to add files to the search space.

In the case of egit I have only one view: The egit repository view, and it doesn't show up in "Project Explorer" or in the list when I want to add files to the search space, so I can only do workspace-wide searches, and such searches fail to find anything in the egit files.

Should the egit files show up in "Project Explorer"? Should they show up when I want to add files to the search space? What is your own experience?

Thanks for any help you can give. I'm really frustrated.

[Updated on: Thu, 12 July 2012 03:09]

Report message to a moderator

Re: Searching a git project [message #895420 is a reply to message #895201] Thu, 12 July 2012 19:28 Go to previous messageGo to next message
Manuel Doninger is currently offline Manuel DoningerFriend
Messages: 119
Registered: October 2010
Senior Member
You have to import your projects from the Git repository into your workspace. To do that, right click on the repository in the Git Repositories view, and select Import Projects. Now you can import all existing projects in the Git repository into the workspace, and then searching should work.
Re: Searching a git project [message #895452 is a reply to message #895420] Fri, 13 July 2012 04:16 Go to previous messageGo to next message
Bruce Sherwood is currently offline Bruce SherwoodFriend
Messages: 5
Registered: July 2012
Junior Member
Hurray! It works! Thank you so much. I had tried this (right-click egit repository, import projects) but encountered various error messages and abandoned the attempt. I had also thought I'd seen statements that a project was being set up for me when I cloned the repository. But thanks to your pointer, this time I fought my way through the various import options and found that "Use the New Project wizard" worked. Probably something was out of whack, because the wizard claimed that a project already existed, but thankfully it let me go ahead and overwrite. Now the project does display in the Project Explorer, and I can set up a search filter and use it. Whew.
Re: Searching a git project [message #997855 is a reply to message #894543] Tue, 08 January 2013 21:59 Go to previous messageGo to next message
Toby F is currently offline Toby FFriend
Messages: 1
Registered: January 2013
Junior Member
I found this topic while looking for help in trying to search a git repo that I cloned, but the "Use the New Project wizard" didn't work for me, so I thought I'd post what I did.

First, here's some basics on my eclipse setup:

Eclipse IDE for JavaScript Web Developers.

Version: Indigo Service Release 2
Build id: 20120216-1857

I had set my workspace (which is what you get prompted to pick every time you open eclipse, unless you suppress the dialog) to the same root as my git local folder. That seemed right, since I planned on only working on git repos. Well, that seemed to confuse egit or eclipse (who knows) when doing an import.

I tried changing my workspace to the local directory one up from my git one and the import worked with existing project. I then found the text I was looking for throughout the git source files.

Hope that helps another desperate soul. I spent hours on this (piece of *&%$#).
Re: Searching a git project [message #998232 is a reply to message #997855] Wed, 09 January 2013 16:06 Go to previous messageGo to next message
Stefan Lay is currently offline Stefan LayFriend
Messages: 342
Registered: July 2009
Senior Member
You might check if http://wiki.eclipse.org/EGit/User_Guide#Considerations_for_Git_Repositories_to_be_used_in_Eclipse answers some of your questions.
Re: Searching a git project [message #1724808 is a reply to message #895452] Fri, 26 February 2016 08:46 Go to previous messageGo to next message
Virgilio Ravagli is currently offline Virgilio RavagliFriend
Messages: 1
Registered: February 2016
Location: Genova, Italy
Junior Member
Hi Bruce and all.
I found a similar problem of yours.

I'm working with three PyDev Django projects, I call them A, B and C. They are not new projects, I have to start taking them from a remote Git Server, where there are A.git, B.git and C.git.

So, I start Eclipse, Git perspective, I clone A and B as local, and when I switch to PyDev perspective I see them fine.
But when I do the same operation for C, I see the project in Git perspective, but switching in PyDev perspective I see...nothing !
Confused
It isn't fair.

Luckily I found this post and was able to workaround: coming back to Git perspective, using "import projects" as a new project, and all is good.

The strange thing is: why does it work fine for A and B, and fail for C ? I haven't been able till now to figure it out.

The only difference between A and B on one side, and C on the other side, is this: C's name is longer than the other names.

Mah...


Re: Searching a git project [message #1724935 is a reply to message #1724808] Sat, 27 February 2016 10:45 Go to previous message
Matthias Sohn is currently offline Matthias SohnFriend
Messages: 1268
Registered: July 2009
Senior Member
Most Eclipse views only show resources located in an Eclipse project (defined in a .project file sitting in the root of the respective Eclipse project).
If a repository doesn't contain any .project file you can clone it with EGit and do all kinds of git operations on it since it handles all resources
contained in the repository which may contain many Eclipse projects and also some files which are not located in any Eclipse project.
But after cloning you wouldn't see the contained files since you are lacking Eclipse projects.

If you are using Maven you can do "Import existing Maven project" to generate Eclipse projects from the information present
in pom.xml (for that you need to install the Maven integration for Eclipse m2e e.g. from the Eclipse marketplace).

Or you can use the "Import projects" wizard in EGit repositories view to create an Eclipse project.
Previous Topic:Create Remote Git Repository using JGIT
Next Topic:Fetching/checking out files without Cloning the Entire GIT Repository
Goto Forum:
  


Current Time: Thu Apr 25 12:42:50 GMT 2024

Powered by FUDForum. Page generated in 0.04035 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top