Eclipse Git plugin - remove file from repo without

2019-02-02 08:32发布

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)

5条回答
再贱就再见
2楼-- · 2019-02-02 08:41

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

查看更多
戒情不戒烟
3楼-- · 2019-02-02 08:42
Team -> Advanced -> Untrack

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

查看更多
forever°为你锁心
4楼-- · 2019-02-02 08:45

Another option, similar to what Sri Sankaran suggests in the comments, is to update the index in order to assume no modification to your config file:

On the preferences, in Egit, you can list "assumed unchanged" files :

assume unchanged

The file remains versioned and on the disk, but no modification will be detected on it.

查看更多
ゆ 、 Hurt°
5楼-- · 2019-02-02 09:00

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.

查看更多
\"骚年 ilove
6楼-- · 2019-02-02 09:07

If you need to delete invisible folder(or file) from eclipse project:

  1. Add folder(or file) to .gitignore file;
  2. Replace folder to another directory
  3. Team add to index, commit and push
  4. Replace folder(or file) to the project folder
查看更多
登录 后发表回答