Including an empty directory in a Git repo is usually an anti-pattern, but can be done by creating an empty file.
This can work even if the directory itself is in
This example assumes
build/ contents should be ignored by Git, but the empty directory should exist in the Git repo.
make an empty file in
build/and add it to Git:
touch build/.ignore git add -f build/.ignore
git commitas usual.