How do I configure git to ignore some files locally?

前端 未结 11 1148
深忆病人
深忆病人 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:43

    I think you are looking for:

    git update-index --skip-worktree FILENAME
    

    which ignore changes made local

    Here's http://devblog.avdi.org/2011/05/20/keep-local-modifications-in-git-tracked-files/ more explanation about these solution!

    to undo use:

    git update-index --no-skip-worktree FILENAME
    

提交回复
热议问题