0

I am using android studio. While commiting my changes, one file gets modified automatically

    modified:   .idea/misc.xml

I don't want to add this file to my commit(Because it is autogenerated). I had added this to gitignore. But it still tracks. Is there any way to remove this file?

AtHul Antony
  • 77
  • 1
  • 11
  • 1
    Possible duplicate of [How to make Git "forget" about a file that was tracked but is now in .gitignore?](http://stackoverflow.com/questions/1274057/how-to-make-git-forget-about-a-file-that-was-tracked-but-is-now-in-gitignore) – 1615903 Mar 22 '17 at 07:32
  • @1615903 But do we know for certain that this file was previously tracked? Perhaps one of his coworkers accidentally committed the file, and now everyone is getting hosed. – Tim Biegeleisen Mar 22 '17 at 07:32
  • Use `git rm --cached .idea/misc.xml`, then push. This should remove it from the repo, it it's actually there. – Tim Biegeleisen Mar 22 '17 at 07:33
  • 1
    Yes, we know that it was tracked, because the status message says "modified" instead of "new" – 1615903 Mar 22 '17 at 07:33
  • I am getting error like `fatal: pathspec '.idea/misc.xml' did not match any files` @1615903 @Tim – AtHul Antony Mar 22 '17 at 08:05
  • Ok, what exactly is the output of `git status` and what exactly is the contents of your `.gitignore` file? – 1615903 Mar 22 '17 at 08:17

0 Answers0