Use:
*.dll #Exclude all dlls
!foo.dll #Except for foo.dll
From gitignore:
An optional prefix ! which negates the pattern; any matching file excluded by a previous pattern will become included again. If a negated pattern matches, this will override lower precedence patterns sources.
More Related Contents:
- How can I make Git "forget" about a file that was tracked, but is now in .gitignore?
- What are the differences between .gitignore and .gitkeep?
- Make .gitignore ignore everything except a few files
- .gitignore for Visual Studio Projects and Solutions
- Gitignore not working
- How to ignore certain files in Git?
- How do I ignore files in a directory in Git?
- .gitignore and “The following untracked working tree files would be overwritten by checkout”
- How can I stop .gitignore from appearing in the list of untracked files?
- How do I make Git forget about a file that was tracked, but is now in .gitignore?
- Using .gitignore to ignore everything but specific directories
- gitignore all files of extension in directory
- Git is ignoring files that aren’t in gitignore
- gitignore binary files that have no extension
- Git excludesfile for a branch
- Definitive retroactive .gitignore (how to make Git completely/retroactively forget about a file now in .gitignore)
- Why doesn’t Git ignore my specified file?
- gitignore does not ignore folder
- Git: How to remove file from index without deleting files from any repository
- How to ignore all hidden directories/files recursively in a git repository?
- Is there a way to tell git to only include certain files instead of ignoring certain files?
- Git – Creating a .gitignore file
- Remove directory from remote repository after adding them to .gitignore
- Definitive retroactive .gitignore (how to make Git completely/retroactively *forget* about a file now in .gitignore)
- How to .gitignore all files/folder in a folder, but not the folder itself? [duplicate]
- Why is .gitignore not ignoring my files?
- git ignore all files of a certain type, except those in a specific subfolder
- Git Ignores and Maven targets
- working with .git/info/exclude too late
- Ignoring a directory from a Git repo after it’s been added