Subdirectory ignored in .gitignore whitelist

This question already has an answer here:

  • Git Won't Un-Ignore a Directory

    4 answers

  • Git changelog: how to get all changes up to a specific tag?
  • Git - checked out a file from a previous commit, did I lose the uncommitted work I had?
  • Can I checkout a tree object in git?
  • Cruise Control .Net exception writing msbuild-results.xml
  • Limiting file size in git repository
  • Errors in dumping a remote Git based SVN repository over HTTP
  • Can I share an entire Git project via Gist?
  • Why is `git show` indentation inconsistent?
  • Git Source Control Provider hotkeys
  • GIT: Any way to set default login credentials?
  • Which git flow is the best for a small team where all developers work on all the projects?
  • How to disable chome's “Search GitHub” feature?
  • One Solution collect form web for “Subdirectory ignored in .gitignore whitelist”

    From the docs:

    It is not possible to re-include a file if a parent directory of that file is excluded

    You need to explicitly unignore both the directory and its contents, or else the ignore rule negating the contents cannot match anything. First, unignore scripts, and then you can unignore scripts/*.

    Here is the working .gitignore:


    That said, because you’re unignore *, you can get away with just one rule, which unignores the path scripts. The second scripts/* is redundant.

    Git Baby is a git and github fan, let's start git clone.