Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio showing unchanged files in commit changes dialog box

I am using Android Studio 2.0 Beta 6 on Ubuntu GNOME. I am facing a strange problem. I am using git version control in my Android project. After building the project, when I click on commit changes through Android Studio GUI. The commit changes dialog box shows every file as changed. When I click on any file, it says contents are identical. I am attaching the screenshot below, clicking on any files says contents are identical.

enter image description here

So my question is, Why Android Studio shows files with identical changes in commit changes dialog and how can I solve it? I tried google but didn't found any related question.

like image 964
brainbreaker Avatar asked Mar 25 '16 20:03

brainbreaker


3 Answers

It must be because of automatic file encoding changes by the IDE (In case you imported the project from somewhere else). Sometimes IDEs apply them automatically. Just revert the changes and do a clean and build. If the changes appear again, you will need to do a commit once and after that you'll be allright.

To verify you can just go to a normally behaving file. Open it in notepad and just save as from notepad with another encoding. It should show as modified thereafter in the version control window.

like image 84
AndroidMechanic - Viral Patel Avatar answered Nov 11 '22 12:11

AndroidMechanic - Viral Patel


For me it was AS pointing to old git version. Please check the Settings\Version Control\Git

AS Settings\Version Control\GIT

like image 39
Anton Avatar answered Nov 11 '22 11:11

Anton


I ran into this issue as well. None of the typical culprits seemed to be at fault. As far as git (from the command line) was concerned, the files were unmodified, yet Android Studio still showed them as modified.

It turns out Android Studio and my command line terminal (cygwin) were using two completely different Git binaries. Android Studio was pointing to a Git installation I had made at some point in the past, while cygwin was pointing to /usr/bin/git, which had come from Cygwin's Git package.

I edited Android Studio's version control settings (as shown in Anton's screenshot) to point to the git.exe within my Cygwin distribution, then did a "refresh file status" from the VCS menu, and all the files went back to showing as unmodified.

like image 38
Jake Cohen Avatar answered Nov 11 '22 13:11

Jake Cohen