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.
Related
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?
I'm more or less a git newbie, trying to get a good Setup to work in Eclipse with egit. I'm running Kepler with latest updates.
Originally I Setup the structure inside the Workspace Directory.
+Workspace/.git
+Workspace/TheProject
Using this Setup (admittedly with Juno) commits were taking forever. For this and other reasons I'd like to move git outside the Workspace Directory, outside eclipse in a parallel Directory.
+OtherDirectory/.git
+Workspace/TheProject
But I'm not getting very far. There seems to be no easy way to split the EXISTING git to another Location without having the Project move there too(!?)
I've tried e.g. Cloning the existing git (in the git repository perspective) and having it Import the Project in the same move.
I've tried just Cloning the existing git, without selection of "Import Project" at the same time.
Then I right clicked the cloned repository and went through the Import Existing Project dialog. I don't get a Chance to say where the Project should be loaded to.
In both cases the Project Ends up in the same Directory as the .git Directory (now outside the Workspace)
+OtherDirectory/.git
+OtherDirectory/TheProject
and not as I wish - to have the Project in the Workspace Directory.
This must be possible (?), but how?
Simply copy the .classpath and .project from Workspace/TheProject or OtherDirectory/TheProject, to otherDirectory (where the .git folder is).
Then import your project into the workspace, as in "Eclipse - Import an existing project?"
Everything will remain in OtherDirectory/ (outside your Eclipse workspace folder), but will be visible in your Eclipse workspace.
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).
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.
I installed EGit on Juno and created a Java project in workspace of Eclipse. Then I shared that project to Git. Then when I check the project's properties, I found that the project had been moved from its original workspace into Git local repository. When I make some changes in Eclipse editor, the changes are made on the local repository without commit.
How to isolate Eclipse workspace from git local repository?
(Well, my Eclipse workspace is ~/Documents/workspace, my git local repository is ~/git/myrepository1. )
The workspace is still in its original location outside of edit. It's the projects that have been moved into the git-controlled directories. Normally projects are created in the Eclipse workspace folder but you can override that default.
If you really want to isolate changes from git, you'll have to break git's control of the project, but you may still have to move the project contents back into your workspace. Unfortunately, the process of getting further changes back into git gets really messy.
I've found it unnerving at first the way git controls my eclipse projects, but after a while it does begin to make sense and is really a very powerful version control function.