How to ignore a file or directory in git, be it tracked, untracked or even part of commit

后端 未结 4 986
悲&欢浪女
悲&欢浪女 2021-01-19 23:29

I want to completely ignore a part of a git repository. The directory is currently tracked in the repository and I\'d like to ensure that

  • whenever anybody chan
4条回答
  •  既然无缘
    2021-01-20 00:07

    You can easily remove and untrack the files with git rm which seems to be what you want to do. If the files are automatically generated during the build process, this seems to be the route you want to take.

    However, if only a single person has their machine setup to properly generate these files, I believe a bigger problem exists. But to do what you want, this is the way

    Start ignoring changes git update-index --assume-unchanged

    Start caring again git update-index --no-assume-unchanged

提交回复
热议问题