git 如何实现 include 声明?

我不希望 git 记录 npz 结尾的文件

所以我在 .gitignore 里面添加了 *.npz

但是呢,我并不是所有的 npz 都想忽略

我想让 git 只追踪 testing/std.npz

如何声明让 git 忽略除了 testing/std.npz 之外的所有 npz 文件呢?

阅读 2.4k
1 个回答

我知道了,可以用感叹号声明

*.npz
!testing/std.npz
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进