Rename refactor project EGit does NOT rename git working tree folder

If I refactor to rename ( Alt+ Shift+ R) the project (which updates the links along with the resource name change) in Eclipse that was split in the git repository, then the .project is changed and displayed as a Git View .

But the project folder was not renamed to the git working directory, so the specified project name in the Package / Navigator view is different from the git working directory.

Is this a bug in EGit? Or are there ways to automatically change the folder name in the git working directory so that I can commit these changes.

Please note that renaming other folders / files works fine.

+3


source to share


3 answers


Just use Refactor -> Move after right clicking on the project. You can also use ( Alt+ Shift+ V). Everything seems to be fine git.



enter image description here

+5


source


This behavior is not related to Git or EGit. In Eclipse, a workspace project is not exposed through the filesystem folder it resides in. This is the file .project

that describes the project.

Although the project is usually located in a folder with the same name, this is not required. For example, a named project bar

can be located in the folderfoo

/path/to/foo/.project

      

Contents .project

:



<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
  <name>bar</name>
  ...
</projectDescription>

      

The Rename Project command does not touch the folder where the project is located. The command only changes the project name as it appears in the file .project

.

Hence, EGit will show the file .project

as modified, but nothing else. Like borjab , you can use the Move ( Alt+Shift V) command to change the location of the project.

+2


source


I guess the problem is that the root folder of the project is not part of the git repository. Thus, you cannot change the project directory name from your local clone. If you are using a git hub, you can change the repository name as shown here .

Steps to change the project name (hopefully this works)

  • Refactoring a project from eclipse
  • Push all modified files to the remote git node (this will contain the .project file)
  • Rename the repo to github.

Hope this helps.

0


source







All Articles