PhpStorm Git 一直说:未检测到任何更改

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/22339334/
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 09:49:38  来源:igfitidea点击:

PhpStorm Git keeps saying: no changes detected

gitversion-controlphpstormjetbrains-ide

提问by cuarti

I tried to work with PhpStormand Git. I have previous experience using NetBeansand I didn't have any problem with Giton NetBeans.

我尝试使用PhpStormGit。我以前有使用NetBeans 的经验,而且我在 NetBeans 上使用Git没有任何问题。

With PhpStormI create the project clicking

使用PhpStorm我创建项目点击

Checkout from Version Control -> GitHub.

从版本控制 -> GitHub 签出。

After that, I created a file and I didn't see any file in Changeslist, under Version Control.

之后,我创建了一个文件,但在Version Control下的Changes列表中没有看到任何文件。

I clicked Pushand a dialog with message

我点击了推送和一个带有消息的对话框

No changes detected

未检测到任何更改

appears.

出现。

A month ago I tried to do the same with PyCharmand I got the same problem. I found an online blog which addressed the problem. I tried to do what all people said with no success.

一个月前,我尝试用PyCharm做同样的事情,但遇到了同样的问题。我找到了一个解决这个问题的在线博客。我试图按照所有人所说的去做,但没有成功。

I've read something like IDE has the path in the project path not in project git path, but when I changed, only an error appeared.

我读过类似IDE在项目路径中的路径而不是在项目git路径中的内容,但是当我更改时,只出现了一个错误。

Has someone any idea how to fix it, like changing something in configuration or from git files?

有人知道如何修复它,例如更改配置或 git 文件中的某些内容吗?

回答by kaseOga

Well, i know this post is to old but... i found a solution clicking on VCS | Refresh File Status, hope this help someone :)

好吧,我知道这篇文章已经过时了,但是...我找到了一个解决方案VCS | Refresh File Status,希望这对某人有所帮助:)

回答by Rich Remer

I ended up going to the VCS menu and selecting something like "Enable Version Control Integration".

我最终进入了 VCS 菜单并选择了“启用版本控制集成”之类的东西。

PHPStorm has a lot of these little stupid design failures, unfortunately.

不幸的是,PHPStorm 有很多这些愚蠢的设计失败。

回答by Ahmet Cetin

Had the same problem recently, webstorm didn't detect changes and color of the file that I was changing turned to greenish. If VCS | Refresh File Statussolves your problem temporarily, and after you make changes again, still you have the same problem, then check Preferences | Version Control | Ignored Files. In my case all files were ignored somehow, after removing it, it works properly.

最近遇到了同样的问题,webstorm 没有检测到我正在更改的文件的更改和颜色变成了绿色。如果VCS | Refresh File Status暂时解决了你的问题,再次修改后还是同样的问题,请检查Preferences | Version Control | Ignored Files。在我的情况下,所有文件都以某种方式被忽略,删除它后,它可以正常工作。

回答by Eric Seyden

See this declined bug in PHPStorm

在 PHPStorm 中看到这个被拒绝的错误

You need to tell git to not ignore case and it will fix this behavior

你需要告诉 git 不要忽略大小写,它会解决这个问题

git config --global core.ignorecase false

回答by Dave

Years later, same problem here. I admit I'm not yet an open source expert and come from an MS background, enthusiastic about broadening my horizons! But I know something is not right with the Git integration in this program.

多年后,同样的问题在这里。我承认我还不是开源专家,来自 MS 背景,热衷于拓宽视野!但我知道这个程序中的 Git 集成有些不对劲。

Anyway, luckily recreating the project is incredibly easy. (I'm using PyCharm but it looks like a close copy of PHPSTorm) In doing so, I noticed that when I change the default path for the .Git repository, this problem happens.

无论如何,幸运的是,重新创建该项目非常容易。(我正在使用 PyCharm,但它看起来像是 PHPSTorm 的一个紧密副本)这样做时,我注意到当我更改 .Git 存储库的默认路径时,会发生此问题。

When I keep the default path for the .Git files, things seem to work as intended.

当我保留 .Git 文件的默认路径时,事情似乎按预期工作。

回答by Alex

Before you can commit a new file to Git, you need to add the file. From the command-line, this is done with git add <file>. To add a file to Git in PhpStorm, go to the Project tool window, select the file to be added, and choose "Git | Add" from the context menu. Also, before you can push changes, you need to commit them. In PhpStorm, this is done like this:

在向 Git 提交新文件之前,您需要添加该文件。在命令行中,这是通过git add <file>. 要在 PhpStorm 中向 Git 添加文件,请转到“项目”工具窗口,选择要添加的文件,然后从上下文菜单中选择“Git | 添加”。此外,在您可以推送更改之前,您需要提交它们。在 PhpStorm 中,这是这样完成的:

  1. In the menu: "View | Tool Windows | Changes" (or Alt-9).
  2. Select whichever files you want to commit.
  3. In the main menu: "VCS | Git | Commit file" (or Ctrl-K).
  4. Add a comment.
  5. In the Git section, set the author using the drop-down list.
  6. Click "Commit".
  1. 在菜单中:“查看 | 工具窗口 | 更改”(或 Alt-9)。
  2. 选择要提交的任何文件。
  3. 在主菜单中:“VCS | Git | Commit file”(或 Ctrl-K)。
  4. 添加评论。
  5. 在 Git 部分,使用下拉列表设置作者。
  6. 单击“提交”。

回答by ivahidmontazer

I solved this problem. gitignorefile was cause of problem. hope this help!

我解决了这个问题。gitignore文件是问题的原因。希望这有帮助!

回答by Wilmer E. Henao

If you're using pycharm. There's a big chance that you opened the file, you worked on it, but you opened it in a different project. Therefore no changes will be detected.

如果您使用的是 pycharm。很有可能你打开了文件,你处理了它,但你在不同的项目中打开了它。因此不会检测到任何变化。

You need to open the file in its corresponding project in order to be detected.

您需要在其对应的项目中打开该文件才能被检测到。

I do this. All. The. Time.

我这样做。全部。这。时间。

回答by FentomX1

My case was, I had another git repository above my current repository so it was nested. After removing the incorrect above repository, for the current nested repository, it was possible to commit and push.

我的情况是,我在当前存储库上方有另一个 git 存储库,因此它是嵌套的。删除上面不正确的存储库后,对于当前嵌套的存储库,可以提交和推送。