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.
Asked
Active
Viewed 200 times
0
-
4you shouldn't be adding R.java to source control, as it is a generated file – panini Apr 13 '14 at 21:28
2 Answers
2
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/

makovkastar
- 5,000
- 2
- 30
- 50
-
Thanks, but alongwith this, I had to use "git rm . -r --cached" as explained here http://stackoverflow.com/questions/11451535/gitignore-not-working , to get it working. – Seekay Jun 02 '14 at 05:49
0
The .gitignore file that covers the current directory may have a *.java exclusion in it. You can include these files if you remove these definitions from .gitignore

thinkbigthinksmall
- 894
- 5
- 10
- 19