How do I configure git to ignore some files locally?

前端 未结 11 927
深忆病人
深忆病人 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条回答
  •  闹比i
    闹比i (楼主)
    2020-11-22 01:39

    Update: Consider using git update-index --skip-worktree [...] instead, thanks @danShumway! See Borealid's explanation on the difference of the two options.


    Old answer:

    If you need to ignore local changes to tracked files (we have that with local modifications to config files), use git update-index --assume-unchanged [...].

提交回复
热议问题