Eclipse, Git pull to existing repository, where are new projects - eclipse

Using Eclipse 4.21 + Egit 2.20 on Linux, all components are up to date. The Eclipse workspace is linked to a local repository stored outside of the workspace folder. The remote repository is on GitHub.
After a pull (either made within Eclipse or outside using git cmdline), my friend and I can see each other updates or new files in existing projects. But each of us cannot see NEW project added by the other developer. The new project files are on GitHib and are actually saved in the local working folder after the git pull.
No matter how many times I refresh the package explorer view or exit/restart Eclipse. The new project doesn't show up in Eclipse package explorer. Each time, a manual "import existing project" is necessary.
Is it because I added .metadata is the .gitignore file at the root of the repository? More importantly, what is the recommended practice so that new project, deleted projects which are committed to the remote repository to sync automatically in Eclipse package explorer after a git pull?
Thanks in advance for any help.

You are using it as it is designed to be used. The concepts of the Eclipse Workspace and folders in your Git repository don't link that way automatically, just as creating a new directory in the workspace directory doesn't automatically make a new project show up in the UI.

Related

Exporting project to Git in Eclipse vs IntelliJ

I am new to Git and was exploring the Git integration in Eclipse, IntelliJ, and Pycharm. In Eclipse, the way projects get exported seems to be that the project gets added to an existing repo, while in IntelliJ and PyCharm, the project's root directory itself becomes a Git repo. This approach made the most sense to me, but then again I don't have much experience in sharing code. This latter approach is also possible in Eclipse by clicking the "Use or create repository in parent folder of project" checkbox, but when I did so, Eclipse told me that using the parent folder was not recommended.
Now for my question: Why does Eclipse warn against doing precisely what JetBrains IDE's do by default? What are the dangers in using a project's parent folder as a Git repo?
I read online that it has to do with the fact that once the parent folder is created as a repo, you can't add any new projects to the repo. But what are the benefits of adding projects to existing repos vs just making a separate repo for each project to keep everything separate?

Connect existing Eclipse project to existing Git repository

I have an Eclipse workspace in ~/EclipseWorkspaces/Sabia with a number of projects under Ubuntu 15.10. The source code for these projects resides in a Git repository at ~/GitRepositories/Sabia.
I can find no way to tell Eclipse in the Pydev Package Explorer that the projects use the Git Repository. If I try to use Team->Share, the system rejects the Git repository because a directory for each project exists in the repository and Eclipse is trying to move the project to the repository which already has a project directory.
I tried the suggestion by Michal Grzejszczak but unfortunately it does not work because the Git Repository does not contain complete projects, only the source trees for the projects. The Eclipse metadata is in /EclipseWorkspaces, not in the Git Repository so import projects on the Git Repository perspective does not work.
In addition when I tried to delete the projects I got the following error message:
AppFrame (One of my projects) contains resources that are not in sync with /home/jonathan/Dropbox/EclipseWorkspaces/Sabia/AppFrame. Press 'Continue' to force delete`
for half of my projects.
Unfortunately the message gives no more information and I have no idea what kind of problem might actually exist. I am not prepared to delete any flawed projects until I have corrected whatever was wrong.
How can I tell the Eclipse Pydev Package Explorer where the Git repository resides?
You need to first add this repository to Git repositories view in Eclipse. Then remove these project from workspace, but without deleting contents and then the most crucial part import them back with "Import projects..." from context menu after right clicking Working tree of the repo in Git repositories view.
That should make your projects managed by Git.

project is not showing in Eclipse after cloning repository

I changed my workspace to 'C:/folder/proj_folder' , I then cloned the rep to this folder and I can see now the project in "C:/folder/proj_folder/myProject".
But I don't see anything in my package explorer in Eclipse.
I tried making a new local branch from the local Development branch. Then I tried to pull/fetch the project to this new branch from the remote Development branch but this option doesn't exist..
What am I doing wrong?
I can see in eclipse in the Git Repositories window the rep and the working directory folder with all my project. Should I import all of that manually ?
The workspace and your local clones should not physically overlap. Doing so introduces limitations and confusion. Working with a repository that exists remotely correctly is a two-step process: clone it and then import projects from the clone into the workspace, without physically copying them around. Assuming the project's Eclipse metadata files (e.g. .project and .classpath for Java Projects) were committed into the repository, you'll have a nice starting point.

Commit Folder From Local Directory to Online Using SVN

I'm completely new to subversion and I'm unsure how to add and commit a Java Project to an online repository using svn. The goal is to move the important folders in the project including the src, package, and class. I've accessed the online repo and I (assume) I have it as a working copy. When I try to svn add the local project folders however, I am told it is not a working copy. How do I fix this? Is there a way I can make my workspace be the online repo directly? Or do I just copy the folder somehow? I'm using Cygwin and Eclipse.
To add your project to svn you can do it this way:
Right click on your project and select: Team / Share Project...
Select SVN
Select Use Existing Repository Location
Browse to the location you would like your project to reside: typically .../trunk
Click OK and finish
This should have committed your project to SVN. Regarding your question about your entire workspace being the online repo. with each of your individual projects connected to SVN just like I detailed above, you will be able to commit and update your local projects into and from SVN without any issues.

Git workflow: PDT + Egit on Eclipse workspace and Git bare repository

I'm developing a Symfony applicatoin and I'm trying to set up a Git workflow on Eclipse. The workspace (where the project files lies) are located on /home/sfprojects/testing/ and the Git repository is located on /var/git/testing.
Reading over and over all the Git resources I've could found (including "Pro Git" by Scott Chacón, and the EGit user guide (http://wiki.eclipse.org/EGit/User_Guide, among others), it's easy to understand why the Git repository and the Eclipse workspace should not share the same directory, now my big confusion is that I can not see a method to keep both things separated from each other.
Once I've created the Git repository through the wizard, all the project files are moved automatically from the Eclipse workspace to the working directory on /var/git/testing/testing/. For my big surprise, the new created Git repository became into the new project workplace on Eclipse with .git directory in the parent directory. It is not a obvious contradiction?. If I let the mouse pointer over the option "Use or create repository in parent folder of project" a very clear help tag with the following text:
When checked, this wizard will try to find or create a repository in the parent folder hierarchy of the selected projects.
Typically, newly created projects are located in the Eclipse workspace, thus repositories created this way would also end up in the Eclipse workspace.
This is not recommended for several reasons explained in the EGit user guide.
So, after some research, my logical conclusion is to create a Git bare repository and then link it to the project located in the workspace... wrong! bare repositories are not available to a Eclipse project.
I need a serious explanation on this.
Seems that I went wrong about what I thought was a contradiction in the EGit User Guide and the EGit behaviour about moving the project directory to the Git repository.
When the project files are moved as a working directory of the Git repository (with a Git metadata folder at the same level), they're still under the Eclipse control, as Eclipse workspace. But as EGit User Guide says (http://wiki.eclipse.org/EGit/User_Guide#Eclipse_Workspace_and_Repository_working_directory), the .git metadata folder should NOT be into the workspace... well that's when I was wrong, cause it is a Eclipse project/Git working folder... but it IS NOT an Eclipse workspace by any means, so the Git metadata folder is not editable, as any other source project file, just for Git (and the EGit Eclipse plugin, of course).