【问题标题】:.gitignore for Android Studio on Ubuntu 14.04 not ignoring certain files. [tried the usual solutions]Ubuntu 14.04 上的 Android Studio 的 .gitignore 不会忽略某些文件。 [尝试了通常的解决方案]
【发布时间】:2015-07-17 06:48:57
【问题描述】:

git 总是为我的 AS 项目显示这些文件。

Changes not staged for commit:
  (use "git add/rm <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)
    modified:   .idea/.name
    modified:   .idea/compiler.xml
    deleted:    .idea/encodings.xml
    modified:   .idea/gradle.xml
    modified:   .idea/misc.xml
    modified:   .idea/modules.xml
    deleted:    .idea/scopes/scope_settings.xml
    modified:   .idea/vcs.xml
    deleted:    Pronto.iml
    modified:   app/app.iml
Untracked files:
  (use "git add <file>..." to include in what will be committed)
    ***-****.iml
no changes added to commit (use "git add" and/or "git commit -a")

我已经尝试过.gitignore之类的方法 使用 git rm 删除缓存。等等

我的 .gitignore 匹配指向该点的链接。

帮助。谢谢。

【问题讨论】:

    标签: android git android-studio gitignore


    【解决方案1】:

    .gitignore 只忽略未跟踪的文件。由于您的文件已经被 git 跟踪,您可以在这些文件上调用 git rm --cached 以将它们从 git 索引中删除,但将它们保留在工作树中。

    【讨论】:

    • 该命令非常令人不安,我之前使用过它..由于某种原因它会生成一个很长的所有文件列表..在分阶段模式 [甚至 xmls!] 然后我的应用程序不再被 android studio 识别为 gradle 项目。
    猜你喜欢
    • 1970-01-01
    • 2011-03-18
    • 2022-01-17
    • 1970-01-01
    • 2011-07-26
    • 2019-08-29
    • 2018-05-02
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多