diff --git a/modules/.gitignore b/modules/.gitignore
new file mode 100644
index 0000000000000000000000000000000000000000..14877bd3f2741c9f668795c886c2879baf0c5065
--- /dev/null
+++ b/modules/.gitignore
@@ -0,0 +1,41 @@
+# Ignore any files or directories in this directory
+/*
+!/.gitignore
+
+# Explicitly include modules that ship with simplesamlphp
+!/adfs/
+!/authcrypt/
+!/authfacebook/
+!/authlinkedin/
+!/authmyspace/
+!/authorize/
+!/authtwitter/
+!/authwindowslive/
+!/authX509/
+!/authYubiKey/
+!/cas/
+!/casserver/
+!/cdc/
+!/consent/
+!/consentAdmin/
+!/core/
+!/cron/
+!/discopower/
+!/exampleattributeserver/
+!/exampleauth/
+!/expirycheck/
+!/ldap/
+!/memcacheMonitor/
+!/metarefresh/
+!/multiauth/
+!/negotiate/
+!/oauth/
+!/portal/
+!/preprodwarning/
+!/radius/
+!/riak/
+!/saml/
+!/sanitycheck/
+!/smartattributes/
+!/sqlauth/
+!/statistics/