代码之家  ›  专栏  ›  技术社区  ›  xendi

.gitinore默认全部黑名单&手动白名单模式不起作用

  •  0
  • xendi  · 技术社区  · 5 年前

    我正在编写一个生成.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

    0 回复  |  直到 5 年前
    推荐文章