diff --git a/.gitignore b/.gitignore
index 9671ceab155b92f0d8bd647acc2c1d02510616d3..b25c15b81fae06e1c55946ac6270bfdb293870e8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1 @@
 *~
-bin/*
-tmp/*
-output/*
diff --git a/bin/.gitignore b/bin/.gitignore
new file mode 100644
index 0000000000000000000000000000000000000000..d6b7ef32c8478a48c3994dcadc86837f4371184d
--- /dev/null
+++ b/bin/.gitignore
@@ -0,0 +1,2 @@
+*
+!.gitignore
diff --git a/output/.gitignore b/output/.gitignore
new file mode 100644
index 0000000000000000000000000000000000000000..d6b7ef32c8478a48c3994dcadc86837f4371184d
--- /dev/null
+++ b/output/.gitignore
@@ -0,0 +1,2 @@
+*
+!.gitignore
diff --git a/tmp/.gitignore b/tmp/.gitignore
new file mode 100644
index 0000000000000000000000000000000000000000..d6b7ef32c8478a48c3994dcadc86837f4371184d
--- /dev/null
+++ b/tmp/.gitignore
@@ -0,0 +1,2 @@
+*
+!.gitignore