Ignore all files in a directory except a specific file
- Published on
- • 读完预计耗时5 mins•––– 看过
Keep 1 file and ignore others in a directory
.gitignore
# Ignore all file in a directory
directory/*
# Keep only this file
!directory/file-to-keep.ext
Keep 1 file and ignore others in a directory
.gitignore
# Ignore all file in a directory
directory/*
# Keep only this file
!directory/file-to-keep.ext