Git .gitignore to ignore only folder in root directory

Here is my .gitignore


and I have installed git on the folder named project there is a folder named static and another folder called app and inside an app, there is another folder static. The above .gitignore ignore both static folders, That is not what I want.

  • Confusing error message from git
  • Git : how to organize two projects that have common code
  • Cygwin and gitolite 3. How to set it up on windows?
  • Git & Issues about Simultaneous Teamwork
  • How to install Git on Solaris 10?
  • Error while deploying application in heroku
  • What I want is to ignore the folder project/static/ not the folder project/app/static/ How can I do that?

  • msysGit: Why does git log output blank lines?
  • Error push/pull on github: Unable to resolve
  • Git status reports untracked on tracked files
  • How can I add a new file to my Git repository?
  • transmit vs macfusion (osx), a remote drive using Git
  • How do I remove deleted branch names from autocomplete?
  • One Solution collect form web for “Git .gitignore to ignore only folder in root directory”

    Just add / before static/, should be like

    # ^ forward slash before the folder name signifies root dir
    Git Baby is a git and github fan, let's start git clone.