Eclipse Egit 未检测到更改的文件

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10540367/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 18:10:10  来源:igfitidea点击:

Eclipse Egit Not Detecting Changed Files

eclipseegit

提问by Jeff Thomas

I have been using Egit and Eclipse together for well over a year. I recently upgraded my computer and had to reinstall everything. Previously whenever I would make a change to a file it would immediately get picked up by Egit and show with the red highlight and star next to the file name in the project explorer.

我已经一起使用 Egit 和 Eclipse 一年多了。我最近升级了我的电脑,不得不重新安装所有东西。以前,每当我对文件进行更改时,它都会立即被 Egit 选中,并在项目资源管理器中的文件名旁边显示红色突出显示和星号。

I have everything back up and running exactly as it was, however whenever I make a change the change is not picked up by Egit. I have to perform a 'git status' in order for the files to show as ready to be staged in the file explorer. Am I doing something wrong to have Egit automatically detect changed files and has anyone else had this problem?

我已经完全按照原样备份并运行了所有内容,但是每当我进行更改时,Egit 都不会接受更改。我必须执行“git status”才能使文件显示为准备好在文件资源管理器中暂存。我做错了什么让 Egit 自动检测更改的文件并且其他人有这个问题吗?

回答by Matthias Sohn

  • which version of EGit are you using
  • do you get the egit team menu if you right-click any resource in your git tracked project ?
  • if not then you need to do "Team > Share > Git", then check "Use or create repository in parent folder of project". If you are using a very recent nightly build version this will be checked automatically.
  • when you modify a file tracked by (e)git a text decorator ">" should appear in front of the modified file
  • as soon as you stage the modified file (Team > Add) the decorator should show the star
  • also the staging view should always show the git status for all modified files
  • 您使用的是哪个版本的 EGit
  • 如果右键单击 git 跟踪项目中的任何资源,是否会看到 egit 团队菜单?
  • 如果没有,那么您需要执行“团队 > 共享 > Git”,然后选中“在项目的父文件夹中使用或创建存储库”。如果您使用的是最近的每晚构建版本,这将被自动检查。
  • 当您修改 (e)git 跟踪的文件时,文本装饰器 ">" 应出现在修改后的文件前面
  • 一旦您暂存修改后的文件(团队 > 添加),装饰器就应该显示星号
  • 此外,暂存视图应始终显示所有已修改文件的 git 状态

回答by Eran Medan

You need to "Add to index" all files again probably

您可能需要再次“添加到索引”所有文件

Track Changes
Click Team> Addon the project node. (This menu item may read Add to Indexon recent versions of Egit)

跟踪更改
单击项目节点上的团队>添加。(此菜单项在 Egit 的最新版本上可能会显示为“添加到索引”)

(From the EGitdocs:)

(来自EGit文档:)

回答by Gray

What I've found is that you need to make sure that your git repositories are showing up in the Eclipse Git Repositoriesview.

我发现您需要确保您的 git 存储库显示在 EclipseGit Repositories视图中。

  1. In the repositories view, you click on the [very] little Git icon with a green + (plus) sign to Add and Existing Local Git Repository.
  2. Browse to the directory that already has a .gitsubdir and click Finish. You should then see you local repo show up in that list.
  3. Then you can right click on the repo while still in the repositories view and add pull down to Import Projects.
  4. "Import existing projects" is selected. Click Next.
  5. Your project should be checked off. Add it to a working set if necessary. Click Next (maybe Finish).
  1. 在存储库视图中,单击带有绿色 +(加号)的 [非常] 小 Git 图标到Add and Existing Local Git Repository
  2. 浏览到已有子目录的目录,.git然后单击Finish。然后您应该会看到您的本地存储库出现在该列表中。
  3. 然后,您仍可以在存储库视图中右键单击存储库并将下拉菜单添加到 Import Projects.
  4. 选择“导入现有项目”。点击下一步。
  5. 您的项目应该被检查。如有必要,将其添加到工作集。单击下一步(可能是完成)。

回答by Priyanka

If you have already added your files to Stage then change the branch it will ask you to commit/stash/reset

如果您已经将文件添加到 Stage 然后更改分支,它会要求您提交/存储/重置

回答by Glo

I faced the same problem. From your git repository view: Right-click -> Show in git staging

我遇到了同样的问题。从您的 git 存储库视图:右键单击 -> 在 git staging 中显示

回答by Craigo

I had a similar issue where all my changes just disappeared. Somehow, Eclipse had unselected my Git repository. Once I selected it again, they all came back.

我有一个类似的问题,我的所有更改都消失了。不知何故,Eclipse 取消了我的 Git 存储库。一旦我再次选择它,他们都回来了。

enter image description here

在此处输入图片说明