Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse Git plugin - remove file from repo without deleting local

Using the Egit plugin, is it possible to permanently remove a file from source control without deleting the local copy?

I.e., is there a GUI action equivalent to running "git rm --cached"?

(Edited to simplify question)

like image 880
naomi Avatar asked Nov 23 '11 11:11

naomi


People also ask

How do I remove a file from a git repository?

The easiest way to delete a file in your Git repository is to execute the “git rm” command and to specify the file to be deleted. Note that by using the “git rm” command, the file will also be deleted from the filesystem.


3 Answers

I have found the answer. Team->Untrack is indeed the equivalent of "rm --cached". However there is a known bug which produces weird behaviour when you untrack and then try to commit.

https://bugs.eclipse.org/bugs/show_bug.cgi?id=363405

like image 138
naomi Avatar answered Sep 26 '22 09:09

naomi


Team -> Advanced -> Untrack

did the job (git rm --cached) for me.

like image 31
Hermann Schwarz Avatar answered Sep 26 '22 09:09

Hermann Schwarz


I had the same problem, after not initially including directories and files in .ignore. I also tried "Untrack" and "Remove from index" possibility, non of which helped(due to the still unresolved Egit issue). So, in the end I deleted files locally (leaving the project all in bugs), committed and pushed it to the github, and then undid the delete locally and added files to .ignore. Very unelegant, but it worked. I lost a lot of time and nerves on it, and I hope this helps someone.

like image 38
dinafication Avatar answered Sep 23 '22 09:09

dinafication