Search code examples
androidgitr.java-fileposh-git

git checkout . not working on R.java


I am working on an android project through Github. Now, when I pull any commit and do any unwanted changes in working directory, I use git checkout . to revert back. This works fine with all other files but shows R.java still as modified. How to revert R.java file also? I am using PowerShell Git in Windows8.


Solution

  • R.java is automatically generated and shouldn't be checked into VCS. You have to add the following lines to your .gitignore file to prevent generated files to be added to the source control:

    # Generated files
    bin/
    gen/