If I do refactor rename (Alt + Shift + R) a project (which updates the references along with the resource name change) in Eclipse which was shared in git repository, then the .project file will be changed and shown in Git Staging view.
But project folder was not renamed in the git working directory, so the project name in Package/Navigator view shown is different than in the git working directory.
Is it a bug in EGit? Or are there any ways to do automatically change the folder name in git working directory, so that I can commit these changes.
Note that renaming other folders/files is working fine.
Just use Refactor -> Move after right click on the project. You can also use (Alt + Shift + V). Seems to manage git all right.
This behavior is unrelated to Git or EGit. In Eclipse, a workspace project is not represented through the file system folder it is located in. It is the .project
file that describes the project.
While usually a project is located in a folder of the same name this isn't required. For example a project named bar
could be located in folder foo
/path/to/foo/.project
Contents of .project
:
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>bar</name>
...
</projectDescription>
The Rename Project command does not touch the folder in which the project is located. The command only changes the name of the project as it appears in the .project
file.
Consequentially, EGit will show the .project
file as changed but nothing else. As borjab suggests, youd can use the Move (Alt+Shift V) command to change the location of a project.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With