Reputation: 5748
Something very weird is happening.
I am on the master branch of my repository. After calling git pull I get the latest version of the code on the master branch, everything is ok.
But for some reason, Android Studio, after some seconds, changes the code, so that now, even if I do git pull I get Already up-to-date
but if I call git status I see changes not staged in red. How is that possible?
Also, if I click cmd+z
I can see for few seconds how the code added by Android Studio goes away, and immediately comes back.
I tried deleting the entire project and cloning again from the repository, and again I get the latest version of the fresh code, but after few seconds Android Studio changes it.
All that happens in a particular file and section of code.
Upvotes: 0
Views: 351
Reputation: 29794
That's happening because each time you opening a project with Android Studio, it will check for Android Studio project configuration files. When Android Studio did not find any of these files, it will create them. The configuration files will be in the .idea
folder. Therefore, you will see a red mark for those unstaged files.
Upvotes: 0
Reputation: 6794
When you make git pull it doesn't reset or throw the changes you have non staged, you have to commit them the only reason you would see a problem with these files were is there was a conflict and git would notify you and tell you you need to commit before the pull.
so if you want to commit these change you need to do: git add . git commit
or if you want to throw away these changes you need to do: git reset --hard HEAD
that last command would let you with the exact same code as in the remote repository.
Upvotes: 1