This ignores root files & root directories, then un-ignores the root bin directory:
/*
/*/
!/bin/
This way you get all of the bin directory, including subdirectories and their files.
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 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?
- .gitignore after commit [duplicate]
- How to remove files that are listed in the .gitignore but still on the repository?
- gitignore all files of extension in directory
- Force add despite the .gitignore file
- 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
- 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
- working with .git/info/exclude too late
- Ignoring a directory from a Git repo after it’s been added
- Can I include other .gitignore file in a .gitignore file? (like #include in c-like languages)
- Commit empty folder structure (with git) [duplicate]