Home  >  Q&A  >  body text

git .gitignore忽略了文件,每次提交还是会变更这个文件

git .gitignore忽略了文件,每次提交还是会变更这个文件

.gitignore文件内容:
java/.idea/workspace.xml doc/*.tmp *.xml
每次commit都会有workspace.xml这个文件.

给我你的怀抱给我你的怀抱2756 days ago711

reply all(1)I'll reply

  • 怪我咯

    怪我咯2017-04-26 09:04:21

    Because you have added him tracked file里了 用
    git rm --cached java/.idea/workspace.xml
    Remove him

    .gitignore This file is used for the ignore list of untracked files
    If you use add将文件标记为 tracked status .gitignore, it will be invalid

    reply
    0
  • Cancelreply