Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit / JGit » Exit from Eclipse Git(Eclipse Java GIT)
Exit from Eclipse Git [message #1856890] Sat, 07 January 2023 13:35 Go to next message
Christopher V. Kimball is currently offline Christopher V. KimballFriend
Messages: 10
Registered: September 2009
Junior Member
I'd like to get out of GIT on Eclipse.

How do I move Eclipse Projects out of GIT and back into the original Eclipse Workspace?

I'm an absolute novice at both GIT and Eclipse GIT.

Thanks,

Chris Kimball
Re: Exit from Eclipse Git [message #1856891 is a reply to message #1856890] Sat, 07 January 2023 15:05 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
Take note of where your git folder is located on your machine. Delete all the "Git" projects from your workspace WITHOUT deleting them from the file system, do don't check that box. Now use File -> Import -> Existing Projects into Workspace. Locate the git folder from before. The projects should be selected. Take note of the checkbox available. Use the "Copy projects into workspace" to copy the projects from the git clone into the workspace folder.

Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Exit from Eclipse Git [message #1856892 is a reply to message #1856891] Sat, 07 January 2023 18:13 Go to previous messageGo to next message
Christopher V. Kimball is currently offline Christopher V. KimballFriend
Messages: 10
Registered: September 2009
Junior Member
Suppose I'm in Eclipse and looking a project registered in Git. On the file system the project is in the .git working directory. It's not in the usual workspace directory.

How do I "delete a Git project"? That is, remove it from Git and get a chance to leave it on disk? I don't know the command.

Thanks for you assistance!

Chris
Re: Exit from Eclipse Git [message #1856893 is a reply to message #1856892] Sat, 07 January 2023 18:25 Go to previous messageGo to next message
David M. Karr is currently offline David M. KarrFriend
Messages: 801
Registered: July 2009
Senior Member
What do you actually need or want to do? What do you mean by "get out of GIT"?

In general, you should have a location on disk where your git repositories live, I typically put them all in ~/git . Your Eclipse workspace will be in a different place. I create one workspace for each Eclipse distribution. You import from git repositories into your eclipse workspace, although what gets imported into the workspace is really just metadata about the projects, it doesn't import the actual files stored in your git repository.

If you want to stop using Git for some odd reason, then I guess you could delete the Eclipse project from within eclipse, and NOT checking the box for deleting the "project contents", which will be in the git repository. Then, you should copy the current contents of the git repository to some other place, and then delete the ".git" directory in the destination. Then, back in Eclipse, you can import "Existing Projects into Workspace" or "File System", specifying the location you copied the git repository to.

Frankly, you should simply get used to git and get more familiar with it.
Re: Exit from Eclipse Git [message #1856894 is a reply to message #1856893] Sat, 07 January 2023 18:32 Go to previous messageGo to next message
Christopher V. Kimball is currently offline Christopher V. KimballFriend
Messages: 10
Registered: September 2009
Junior Member
Thanks for your quick reply. I got into Git in a rush and set many things up very badly for an 18 project system. It's been a nightmare and a mis-application of git.

With the process which you suggest, am I going to lose the Eclipse project settings associated with each of 18 projects?

Thanks,

Chris
Re: Exit from Eclipse Git [message #1856895 is a reply to message #1856894] Sat, 07 January 2023 19:43 Go to previous messageGo to next message
David M. Karr is currently offline David M. KarrFriend
Messages: 801
Registered: July 2009
Senior Member
When Eclipse imports from a remote location, it creates a handful of "dot files" in the root directory of the repository, like ".project", ".classpath", and ".settings", which are not in the ".git" directory. If you preserve those files, you'll preserve some preferences and project settings. Not that this helps you right now, but note that those dot files should generally NOT be checked into git, because Eclipse tends to modify them (obviously).
Re: Exit from Eclipse Git [message #1856896 is a reply to message #1856895] Sat, 07 January 2023 19:48 Go to previous messageGo to next message
Christopher V. Kimball is currently offline Christopher V. KimballFriend
Messages: 10
Registered: September 2009
Junior Member

Thanks for your good information and patience in this matter.

Chris
Re: Exit from Eclipse Git [message #1856898 is a reply to message #1856895] Sun, 08 January 2023 13:54 Go to previous messageGo to next message
Thomas Wolf is currently offline Thomas WolfFriend
Messages: 576
Registered: August 2016
Senior Member
David M. Karr wrote on Sat, 07 January 2023 19:43
When Eclipse imports from a remote location, it creates a handful of "dot files" in the root directory of the repository, like ".project", ".classpath", and ".settings", which are not in the ".git" directory. If you preserve those files, you'll preserve some preferences and project settings. Not that this helps you right now, but note that those dot files should generally NOT be checked into git, because Eclipse tends to modify them (obviously).


This is not correct. If the Eclipse project is in the git working tree, then that is also where the .project/.classpath/.settings are. (Of course a project is not inside the .git directory. You should never work there directly, that directory is managed by git.) Other plug-in specific data is typically stored in the Eclipse workspace, inside the .metadata sub-directory.

If you keep the place where you store git repository clones separate from the Eclipse workspace, that .metadata directory is never in any git repository, and you don't have to worry about it. If the Eclipse workspace directory is equal to the git working tree directory (or a subdirectory thereof), then you might want to ensure via .gitignore that the files in .metadata directory are ignored and never checked in.

The second part of that quote is highly questionable. That may be what you do, but in my environments, it would be patently false. Do check in .project/.classpath/.settings. That way all Eclipse users who check out the code automatically get the right setup. Eclipse normally does not modify them once created, and if so, you probably also want to check in these modifications so that other users get them, too.
Re: Exit from Eclipse Git [message #1856901 is a reply to message #1856898] Sun, 08 January 2023 16:57 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
I was going to correct that statement too, but I noted that it was specifically mentioning it with respect to "the root directory of the repository" and yes often one does not want a .project file in the root as well as .project files in other nested folders. But sometimes one does want that at the root too. Definitely in general most people do commit these important "project" files!

Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Exit from Eclipse Git [message #1856903 is a reply to message #1856901] Sun, 08 January 2023 18:24 Go to previous message
David M. Karr is currently offline David M. KarrFriend
Messages: 801
Registered: July 2009
Senior Member
If your project is a Maven project, you definitely do NOT want to check in the .classpath file. That file is entirely generated and managed by m2e.
Previous Topic:Behavior changed when pushing a new branch?
Next Topic:Paths with spaces in .gitconfig
Goto Forum:
  


Current Time: Wed Apr 24 22:02:18 GMT 2024

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

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

Back to the top