无法使用 git 提交我的项目

发布于 2024-12-29 19:45:02 字数 360 浏览 2 评论 0原文

我正在使用 git 的 eclipse 插件来提交我的 PHP 项目。 到目前为止一切都很顺利,但是当我提交时突然出现以下错误:

提交失败

发生内部错误

路径找不到条目://ms_system/.../file.php

我注意到提交列表中的某些文件具有无效路径,而不是:

dcms_system/.../file.php

我得到:

//ms_system/.../file.php

这显然是错误的。

我该如何修复它?

I'm using the eclipse plugin for git in order to commit my PHP projects.
Until now everything goes fine but suddenly when I commit i get the following error:

Committing failed

An internal error occurred

Entry not found by path: //ms_system/.../file.php

I notice that some of the files in the commit list has an invalid path, instead of:

dcms_system/.../file.php

I get:

//ms_system/.../file.php

Which is obviously wrong.

How can I to fix it?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

握住我的手 2025-01-05 19:45:03

我有类似的问题。我收到同样的错误,因为我试图提交未添加的文件。为了解决我的问题,我必须在提交之前“添加到索引”。

I had a similar problem. I was receiving the same error because I was trying to commit files which were not added. To resolve my issue I had to "Add To Index" prior to commit.

奶气 2025-01-05 19:45:03

我遇到了同样的问题,只需对项目进行刷新(F5)即可解决。

I had the same problem, it was solved by simply doing a refresh (F5) on the project.

夜雨飘雪 2025-01-05 19:45:03

对我来说,以上答案都不起作用。经过实验,我发现冲突的文件路径被列为未跟踪的文件,您可以在提交页面中选择忽略它们。

即进入Eclipse中的repo视图->右键单击存储库 ->提交->显示未跟踪的文件(默认选择)->查看路径错误的文件并将其从提交中排除

在此处输入图像描述

For me, none of the above answers worked. After experimenting, I found out that the conflicted file paths are listed as untracked files that you can choose to ignore in the commit page.

That is, go to the repo view in Eclipse -> right click on the repo -> commit -> show untracked files (selected by default) -> view files with erroneous paths and exclude them from the commit

enter image description here

琉璃梦幻 2025-01-05 19:45:02

我创建这个作为我未来的自我的参考

以上答案都不适合我。
这是SO(甚至谷歌)上与此相关的唯一问题。

我认为有效的是:

转到 Eclipse 中的 Git Repo View -> rt 单击您的存储库 ->收集垃圾

然后提交

PS:
这可能没有做任何事情,只是记录它

我也在git shell(github shell)上同时运行
存储库根目录上的 git status 命令(这就是我运行的所有命令)。和
令人惊讶地发现没有 Staged/Unstaged 的​​变化,
最终意识到问题已经解决了。

PPS:
如果上述方法不起作用:

转到 Eclipse 中的 Git Repo View -> rt 单击您的存储库 ->收集垃圾-> rt 单击您的存储库 ->清理,然后提交

I'm creating this as a reference for my own future self

None of the above answers worked for me.
This is the only Q on SO (or even google) pertaining to this.

What did work, I think, was:

Goto Git Repo View in eclipse -> rt click on your repo -> collect garbage

then commit

PS:
This might not have done anything but just documenting it

I also was on the git shell (github shell) at the same time running
git status commands (that's all I ran) on the root of the repo. And
surprisingly found that there were no Staged/Unstaged changes,
eventually realizing that the problem was solved.

PPS:
If the above does not work:

Goto Git Repo View in eclipse -> rt click on your repo -> collect garbage -> rt click on your repo -> clean, then commit

扭转时空 2025-01-05 19:45:02

我设法解决这个问题:

  1. 我将有问题的文件夹名称更改为其他名称
  2. 提交
  3. 将有问题的文件夹名称更改为旧的
  4. 提交

不是推荐的解决方案,但它现在正在工作。

I manage to solve this problem:

  1. I change the problematic folder name to something else
  2. Commit
  3. Change the problematic folder name to the old one
  4. commit

Not a recommend solution but it`s working now.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文