0

i just started to use git and i created .gitignore file, after i do changes in one of the java files i see that the git not ignore from files that suppose to ignored. for example: enter image description here

only the Logger.java suppose to be committed and the two other files not.

this is my .gitignore file:

# Built application files
*.apk
*.ap_

# Files for the Dalvik VM
*.dex

# Java class files
*.class

# Generated files
bin/
gen/
out/

# Gradle files
.gradle/
build/

# Local configuration file (sdk path, etc)
local.properties

# Proguard folder generated by Eclipse
proguard/

# Log Files
*.log

# Android Studio Navigation editor temp files
.navigation/

# Android Studio captures folder
captures/

# Intellij
*.iml

# Keystore files
*.jks
CodeWizard
  • 128,036
  • 21
  • 144
  • 167
gil cohen
  • 333
  • 2
  • 8
  • 21

2 Answers2

0

I think you took your gitignore file here: gitignore.io/api/android but you never mention to ignore these two files...
Maybe you should add these two lines in your .gitingore

.idea/workspace.xml
.idea/misc.xml

If you already commited your files, you will probably have to remove these files from you git.
See this post: Cannot ignore .idea/workspace.xml - keeps popping up

Community
  • 1
  • 1
  • I personally use these for my android studio ignore files: # Android Studio / IntelliJ IDEA *.iws .idea/libraries .idea/tasks.xml .idea/vcs.xml .idea/workspace.xml .idea/misc.xml .idea/gradle.xml – Hibbem May 08 '16 at 13:44
  • I just give those files for example, sometimes appears between 15- 20 files and i can't add all of them to the .gitignore – gil cohen May 08 '16 at 14:12
0

You need to add the .idea to the ignored list:

# Add it with the / at the end (since you want to ignore all the folder)
.idea/

# Now remove the files you have already added to the repo
git rm --cached .idea/*

Those files are generated by JetBrain products (in your case android studio IDE) and you have to mark the folder as ignored.

CodeWizard
  • 128,036
  • 21
  • 144
  • 167