1

I have an android project that I work on Android Studio. I work on it mainly on my desktop and I have integrated with git and push all the commits to GitHub. Now when I'm away from my desktop, I use my laptop. I have been using

git pull origin {branch name}

to grab the most recent changes of the project from GitHub to use it on my laptop. When I had committed and pushed it to GitHub from my Desktop, it was in a clean state when I check git status.

Then when I pull the updated project to my laptop, I check its status and I get this message saying these files have not been added:

    modified:   .idea/.name
    modified:   .idea/compiler.xml
    modified:   .idea/misc.xml
    modified:   .idea/modules.xml

But I hadn't changed anything. I just pulled the branch from GitHub. Can someone explain what I should do here to fix this? This keeps happening. I don't want to be committing files that are just .idea files.

Nikola Despotoski
  • 49,966
  • 15
  • 119
  • 148
David Velasquez
  • 2,346
  • 1
  • 26
  • 46
  • 1
    You may want to take a look at this question: http://stackoverflow.com/questions/11124053/accidentally-committed-idea-directory-files-into-git – Steve Cox Mar 10 '16 at 23:11
  • @SteveCox so the solution is just to add every single .idea file to the .gitignore file? Will that create any problems for me in the future if I want to share my code with someone else? – David Velasquez Mar 10 '16 at 23:18
  • 1
    @Ghost_Stark No, this won't create any problems. The entire .idea folder is created by Android Studio and is purely metadata for the IDE to use to define the style, workspace, and personal settings/preferences for your project. None of your code goes in this folder and someone else getting the code later can import this project easily into their own IDE. The only issue I know of that comes with this is that if you set custom auto formatting for the project, it won't be shared because that's saved in the .idea folder. But you can always add specific files back later to fix that if necessary. – Joseph Roque Mar 10 '16 at 23:32
  • @JosephRoque Thanks for the clear explanation! – David Velasquez Mar 10 '16 at 23:39

0 Answers0