Git ignore files being tracked WITHOUT DELETING THEM

后端 未结 5 1348
别跟我提以往
别跟我提以往 2020-12-16 13:09

I\'m having some trouble understanding basic git concepts :/

I\'m testing on my local Windows machine before trying some things on my git-controlled site.

I

5条回答
  •  眼角桃花
    2020-12-16 13:56

    Git only applies ignore patterns to untracked files. You can't use ignore patterns to ignore changes to files that are already tracked by git. Still, see https://gist.github.com/1423106 for ways people have worked around the problem.

    Note if you are worried about .gitignore itself, you can try using .git/info/excludes for a local-repo-only .gitignore file. Note this will not solve the problem of changing tracked files, only give you supplemental .gitignores which will not be tracked.

提交回复
热议问题