Is it possible to have a custom .gitignore? Read only access?

前端 未结 5 1522
生来不讨喜
生来不讨喜 2020-12-12 23:35

I am working in a team environment, and there is already a .gitignore file.

I want to add more items to the .gitignore file, but I don\'t w

5条回答
  •  爱一瞬间的悲伤
    2020-12-13 00:00

    Like Fred Frodo said, you can put your private exclude rules in the .git/info/exclude of the repository.

    If you want to apply the same exclude rules to all the repositories on your machine, you can add the following to the .gitconfig file in your user directory.

    [core]       
        excludesfile = /home//.gitexclude 
    

    Then add your exclude patterns to ~/.gitexclude.

提交回复
热议问题