title: How to ignore all subfolders in a folder with .gitignore
body: <p>I have a folder in Git with some files in it. Files are a part my Git repository. When running my project some work directories appear in this folder. Directories can have any name and any nesting level with multiple sub-directories. I want to ignore all possible sub-directories appearing in this folder but still keep all files (not directories) sitting in root of my folder.</p>
  
  <p>I've tried patterns: </p>
  
  <pre><code>/
  */
  /*
  /*/
  </code></pre>
  
  <p>None of above gives desired result. How it can be accomplished?</p>
  
  <p>Many answers explain how to ignore folders with specific names, for instance
  <a href="https://stackoverflow.com/questions/2545602/git-ignore-sub-folders">Git ignore sub folders</a>.
  But there seem no explanation on how to ignore all sub-folders with wild cards. </p>