2016-05-08 48 views
0

我刚开始使用git,我创建了.gitignore文件后,我做了一个java文件中的更改,我发现git不忽略忽略的文件。例如: enter image description hereAndroid工作室 - gitignore文件

只有Logger.java假定被提交,而其他两个文件不是。

这是我的.gitignore文件:

# 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 
+0

我想你把你的gitignore文件放在这里:https://www.gitignore.io/api/android但你从来没有提到要忽略这两个文件 –

回答

0

我觉得你把你的gitignore文件位置:gitignore.io/api/android但你从来不提忽略这两个文件...
也许你应该在加上这两条线你的.gitingore

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

如果你已经提交了你的文件,你可能必须从你的git中删除这些文件。
看到这个帖子:Cannot ignore .idea/workspace.xml - keeps popping up

+0

我个人使用这些为我的android studio忽略文件: #Android Studio/IntelliJ IDEA的 * .iws .idea /库 .idea/tasks.xml .idea/vcs.xml .idea/workspace.xml .idea/misc.xml .idea/gradle.xml – Reyske

+0

我只是例如,给这些文件,有时出现在15-20个文件之间,我不能将它们全部添加到.gitignore –

0

您需要的.idea添加到忽略列表:

# 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/* 

这些文件是由JetBrain产品所产生的(在你的情况下,机器人工作室IDE),你必须标记文件夹被忽略。

+0

感谢您的答案,但这也不工作 –