How do I configure git to ignore some files locally?

前端 未结 11 899
深忆病人
深忆病人 2020-11-22 01:03

Can I ignore files locally without polluting the global git config for everyone else? I have untracked files that are spam in my git status but I don\'t want to commit git c

11条回答
  •  野趣味
    野趣味 (楼主)
    2020-11-22 01:56

    In order to ignore untracked files especially if they are located in (a few) folders that are not tracked, a simple solution is to add a .gitignore file to every untracked folder and enter in a single line containing * followed by a new line. It's a really simple and straightforward solution if the untracked files are in a few folders. For me, all files were coming from a single untracked folder vendor and the above just worked.

提交回复
热议问题