Instead of doing this, please add a .gitignore to the project root that just has 'build/' as content.