我正在编写一个生成.git文件的实用程序。我从默认排除所有的白名单模式开始,然后使用
!
(not/negative) rules
允许路径返回。
生成的
.gitignore
# Blacklist all by default
*
# Then whitelist what want to track
!.bashrc
!.gitconfig
!.gitignore
!.nvidia-settings-rc
!.p10k.zsh
!.profile
!.zprofile
!.zshrc
!bin/gitignoregen
!credentials.json
!.config/autokey/
!.config/VSCodium/User/snippets/
但后来跑了
git add .config/autokey
The following paths are ignored by one of your .gitignore files:
.config/autokey
.config/autokey