How to use Git Ignore on a self-emptying folder

I’ve got a git repo setup something like

Main
   -> Build
   -> Assets
   -> Resources

However, every time I compile our application, the “Build” directory gets completely wiped, thus deleting any .gitignore files within it.

How can I set a ignore to ignore that directory, from outside of it? something like:

Main/.gitignore

ignore /Build/*
ignore /Build

Many thanks

Update:

Our /Main/.gitignore looks like

### OSX ###
.DS_Store
.AppleDouble
.LSOverride
Icon


# Thumbnails
._*

# Files that might appear on external disk
.Spotlight-V100
.Trashes


### Build ###
# Build folder and log file
Build/
Build/**/*
build.log
build
npm-debug.log
tmp
.map

However SourceTree on OSX is still showing them as available to commit.

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