Why does Android Studio remove the CodeStyleSettings, runConfiguration code and rename the project the first time it is opened?

So, I am cloning a project that I have in a new folder with a different name than the repo name. So, the clone command looks something like this:

git clone --recursive git@example.imtqy.com :/my-repo other-folder-name

After the first time, when I open it in Android Studio 1.4.1, the following files change:

 modified: .idea/.name deleted: .idea/codeStyleSettings.xml deleted: .idea/dictionaries/fronilse.xml deleted: .idea/encodings.xml modified: .idea/gradle.xml modified: .idea/inspectionProfiles/Project_Default.xml modified: .idea/misc.xml deleted: .idea/runConfigurations/I_Tests.xml deleted: .idea/runConfigurations/JTestsVG.xml deleted: .idea/runConfigurations/U_Tests.xml deleted: .idea/runConfigurations/VG.xml deleted: .idea/scopes/scope_settings.xml modified: .idea/vcs.xml 

What's happening? Why does it delete my startup settings and code style settings? Why does it rename my project (in the .name file, the project is renamed under the same name as the folder). I am not allowed to call the folder, what do I need?

Therefore, if I use the same folder name as the repo, no changes occur. The simplest solution is to just go with this, of course, but I wonder if this is the intended functionality or if I can post the problem?

edit: Actually, I was able to reproduce the error even when using the name of the source folder

+6
source share
1 answer

I had the same problem with codeStyle/ directory in Android Studio after cloning the repository. I don’t know how to avoid this, but a simple git reset --hard HEAD at the root of your project will return any changes made by Android Studio to your files.

However, keep in mind that Android Studio will have to modify some files so that it can understand and remember how to read your project. These machine files, such as gradle.xml , should not be added to Git because they are often generated automatically and can change at any time. See this article to learn more about .idea/ .

0
source

Source: https://habr.com/ru/post/1235125/


All Articles