PhpStorm Git keeps saying: no changes detected
Asked Answered
S

12

17

I tried to work with PhpStorm and Git. I have previous experience using NetBeans and I didn't have any problem with Git on NetBeans.

With PhpStorm I create the project clicking

Checkout from Version Control -> GitHub.

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

I clicked Push and a dialog with message

No changes detected

appears.

A month ago I tried to do the same with PyCharm and 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.

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.

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

Shaquitashara answered 12/3, 2014 at 0:6 Comment(0)
A
34

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

Assertion answered 31/12, 2014 at 7:47 Comment(3)
Sure helped me, after an inexplicable "No changes detected."Icarus
the same issue was bugging me really bad, you da real mvp @AssertionEstovers
"Invalidate Caches" and restart phpStorm did it for mePhilo
I
7

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

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

Isaiah answered 25/8, 2014 at 17:40 Comment(0)
B
3

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 Status solves 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.

Basra answered 22/2, 2017 at 13:45 Comment(0)
B
1

See this declined bug in PHPStorm

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

git config --global core.ignorecase false
Baber answered 11/3, 2015 at 17:35 Comment(0)
C
1

I solved this problem. gitignore file was cause of problem. hope this help!

Cat answered 10/4, 2017 at 22:2 Comment(0)
Z
0

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:

  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".
Zeringue answered 12/3, 2014 at 0:14 Comment(7)
When I go to add file, the option is disabled so I can't add the file and In changes there aren't files.Shaquitashara
Try committing without adding the file.Zeringue
Is when I get a "no changes detected" message.Shaquitashara
Did you create the file using PhpStorm, or externally? Is it empty, or does it have something in it? Is the file in the project's directory?Zeringue
I created with PhpStorm. At first it works, but after it doesn't work and I think that when I did push I lost all the files in local and remote repository (but I had a backup), after remote repository has been empty. The file that I want to push is in the project directory.Shaquitashara
So you can't add a file, but it isn't added to git? If so, that's a bug, and it should be reported to PhpStorm's bug tracker. Also, what do you mean by "At first it works, but after it doesn't work"? Do you mean that at first, you can add files and commit, but after a while, you can't?Zeringue
Yes I can't add a file and in changes nothing happens so when I commit, there are nothing to commit. And at first time works, I had remote repository with a real project, I was developing with NetBeans until I wanted to try PhpStorm and when I pull the repository it works fine, but next year it didn't work and I couldn't add files.Shaquitashara
T
0

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.

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.

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

Tocharian answered 3/4, 2015 at 2:14 Comment(0)
C
0

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.

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

I do this. All. The. Time.

Crucifix answered 1/2, 2018 at 0:56 Comment(0)
D
0

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.

Downward answered 10/5, 2020 at 22:48 Comment(0)
S
0

This worked for me.

  1. Close PhpStorm.
  2. Remove the idea folder from the project.
  3. Drag the project folder to the PhpStorm app to re-open the project.

Now your changes will show properly when trying to commit to github.

Sanyu answered 31/5, 2022 at 18:20 Comment(0)
U
0

If the project contains other Directories (Settings -> Directories (Content roots)). Removing all other content roots and keeping only the main one, then reopening PHPStorm potentially can solve a problem.

Untuck answered 16/6, 2023 at 1:2 Comment(0)
D
0

In my case, this was caused by unregistered Git roots, since I have multiple sub-projects within a project, each with its own Git repo.

Go to Settings -> Version Control -> Directory Mappings.

If your sub-project is listed under "Unregistered Roots," click on it, then click on the + button at the top.

Dipterocarpaceous answered 17/6 at 18:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.