diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..125c24d
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,10 @@
+# Global excludes across all subdirectories
+*.o
+*.so
+objfiles.txt
+.deps/
+
+# Local excludes in root directory
+/GNUmakefile
+/config.log
+/config.status
diff --git a/contrib/cube/.cvsignore b/contrib/cube/.cvsignore
deleted file mode 100644
index 19ecc85..0000000
--- a/contrib/cube/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-cubeparse.c
-cubescan.c
diff --git a/contrib/cube/.gitignore b/contrib/cube/.gitignore
new file mode 100644
index 0000000..19ecc85
--- /dev/null
+++ b/contrib/cube/.gitignore
@@ -0,0 +1,2 @@
+cubeparse.c
+cubescan.c
diff --git a/contrib/seg/.cvsignore b/contrib/seg/.cvsignore
deleted file mode 100644
index aa740d3..0000000
--- a/contrib/seg/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-segparse.c
-segscan.c
diff --git a/contrib/seg/.gitignore b/contrib/seg/.gitignore
new file mode 100644
index 0000000..aa740d3
--- /dev/null
+++ b/contrib/seg/.gitignore
@@ -0,0 +1,2 @@
+segparse.c
+segscan.c
diff --git a/doc/src/sgml/.cvsignore b/doc/src/sgml/.cvsignore
deleted file mode 100644
index ed986e3..0000000
--- a/doc/src/sgml/.cvsignore
+++ /dev/null
@@ -1,6 +0,0 @@
-html
-html-stamp
-man1
-man3
-man7
-man-stamp
diff --git a/doc/src/sgml/.gitignore b/doc/src/sgml/.gitignore
new file mode 100644
index 0000000..ed986e3
--- /dev/null
+++ b/doc/src/sgml/.gitignore
@@ -0,0 +1,6 @@
+html
+html-stamp
+man1
+man3
+man7
+man-stamp
diff --git a/src/.gitignore b/src/.gitignore
new file mode 100644
index 0000000..81ee836
--- /dev/null
+++ b/src/.gitignore
@@ -0,0 +1,2 @@
+Makefile.global
+Makefile.port
diff --git a/src/backend/.gitignore b/src/backend/.gitignore
new file mode 100644
index 0000000..f134994
--- /dev/null
+++ b/src/backend/.gitignore
@@ -0,0 +1 @@
+postgres
diff --git a/src/backend/bootstrap/.cvsignore b/src/backend/bootstrap/.cvsignore
deleted file mode 100644
index 5201be9..0000000
--- a/src/backend/bootstrap/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-bootparse.c
-bootscanner.c
diff --git a/src/backend/bootstrap/.gitignore b/src/backend/bootstrap/.gitignore
new file mode 100644
index 0000000..5201be9
--- /dev/null
+++ b/src/backend/bootstrap/.gitignore
@@ -0,0 +1,2 @@
+bootparse.c
+bootscanner.c
diff --git a/src/backend/catalog/.cvsignore b/src/backend/catalog/.cvsignore
deleted file mode 100644
index 242e321..0000000
--- a/src/backend/catalog/.cvsignore
+++ /dev/null
@@ -1,4 +0,0 @@
-postgres.bki
-postgres.description
-postgres.shdescription
-schemapg.h
diff --git a/src/backend/catalog/.gitignore b/src/backend/catalog/.gitignore
new file mode 100644
index 0000000..242e321
--- /dev/null
+++ b/src/backend/catalog/.gitignore
@@ -0,0 +1,4 @@
+postgres.bki
+postgres.description
+postgres.shdescription
+schemapg.h
diff --git a/src/backend/parser/.cvsignore b/src/backend/parser/.cvsignore
deleted file mode 100644
index 6545728..0000000
--- a/src/backend/parser/.cvsignore
+++ /dev/null
@@ -1,3 +0,0 @@
-gram.h
-gram.c
-scan.c
diff --git a/src/backend/parser/.gitignore b/src/backend/parser/.gitignore
new file mode 100644
index 0000000..6545728
--- /dev/null
+++ b/src/backend/parser/.gitignore
@@ -0,0 +1,3 @@
+gram.h
+gram.c
+scan.c
diff --git a/src/backend/port/.gitignore b/src/backend/port/.gitignore
new file mode 100644
index 0000000..91b0e7e
--- /dev/null
+++ b/src/backend/port/.gitignore
@@ -0,0 +1,5 @@
+dynloader.c
+pg_latch.c
+pg_sema.c
+pg_shmem.c
+tas.s
diff --git a/src/backend/snowball/.gitignore b/src/backend/snowball/.gitignore
new file mode 100644
index 0000000..725f914
--- /dev/null
+++ b/src/backend/snowball/.gitignore
@@ -0,0 +1 @@
+snowball_create.sql
diff --git a/src/backend/utils/.cvsignore b/src/backend/utils/.cvsignore
deleted file mode 100644
index a2ff9bb..0000000
--- a/src/backend/utils/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-fmgrtab.c
-fmgroids.h
diff --git a/src/backend/utils/.gitignore b/src/backend/utils/.gitignore
new file mode 100644
index 0000000..3f79b70
--- /dev/null
+++ b/src/backend/utils/.gitignore
@@ -0,0 +1,3 @@
+fmgrtab.c
+fmgroids.h
+probes.h
diff --git a/src/backend/utils/mb/conversion_procs/.gitignore b/src/backend/utils/mb/conversion_procs/.gitignore
new file mode 100644
index 0000000..9c19b5e
--- /dev/null
+++ b/src/backend/utils/mb/conversion_procs/.gitignore
@@ -0,0 +1 @@
+conversion_create.sql
diff --git a/src/backend/utils/misc/.cvsignore b/src/backend/utils/misc/.cvsignore
deleted file mode 100644
index b188561..0000000
--- a/src/backend/utils/misc/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-guc-file.c
diff --git a/src/backend/utils/misc/.gitignore b/src/backend/utils/misc/.gitignore
new file mode 100644
index 0000000..b188561
--- /dev/null
+++ b/src/backend/utils/misc/.gitignore
@@ -0,0 +1 @@
+guc-file.c
diff --git a/src/bin/initdb/.gitignore b/src/bin/initdb/.gitignore
new file mode 100644
index 0000000..29579bf
--- /dev/null
+++ b/src/bin/initdb/.gitignore
@@ -0,0 +1,4 @@
+encnames.c
+pqsignal.c
+
+initdb
diff --git a/src/bin/pg_config/.gitignore b/src/bin/pg_config/.gitignore
new file mode 100644
index 0000000..fe901db
--- /dev/null
+++ b/src/bin/pg_config/.gitignore
@@ -0,0 +1 @@
+pg_config
diff --git a/src/bin/pg_controldata/.gitignore b/src/bin/pg_controldata/.gitignore
new file mode 100644
index 0000000..899a37e
--- /dev/null
+++ b/src/bin/pg_controldata/.gitignore
@@ -0,0 +1,3 @@
+pg_crc.c
+
+pg_controldata
diff --git a/src/bin/pg_ctl/.gitignore b/src/bin/pg_ctl/.gitignore
new file mode 100644
index 0000000..e10a954
--- /dev/null
+++ b/src/bin/pg_ctl/.gitignore
@@ -0,0 +1 @@
+pg_ctl
diff --git a/src/bin/pg_dump/.gitignore b/src/bin/pg_dump/.gitignore
new file mode 100644
index 0000000..9423492
--- /dev/null
+++ b/src/bin/pg_dump/.gitignore
@@ -0,0 +1,5 @@
+kwlookup.c
+
+pg_dump
+pg_dumpall
+pg_restore
diff --git a/src/bin/pg_resetxlog/.gitignore b/src/bin/pg_resetxlog/.gitignore
new file mode 100644
index 0000000..30f2755
--- /dev/null
+++ b/src/bin/pg_resetxlog/.gitignore
@@ -0,0 +1,3 @@
+pg_crc.c
+
+pg_resetxlog
diff --git a/src/bin/psql/.cvsignore b/src/bin/psql/.cvsignore
deleted file mode 100644
index d666d4c..0000000
--- a/src/bin/psql/.cvsignore
+++ /dev/null
@@ -1,3 +0,0 @@
-psqlscan.c
-sql_help.h
-sql_help.c
diff --git a/src/bin/psql/.gitignore b/src/bin/psql/.gitignore
new file mode 100644
index 0000000..6770a92
--- /dev/null
+++ b/src/bin/psql/.gitignore
@@ -0,0 +1,8 @@
+psqlscan.c
+sql_help.h
+sql_help.c
+dumputils.c
+keywords.c
+kwlookup.c
+
+psql
diff --git a/src/bin/scripts/.gitignore b/src/bin/scripts/.gitignore
new file mode 100644
index 0000000..3460228
--- /dev/null
+++ b/src/bin/scripts/.gitignore
@@ -0,0 +1,15 @@
+clusterdb
+createdb
+createlang
+createuser
+dropdb
+droplang
+dropuser
+reindexdb
+vacuumdb
+
+dumputils.c
+keywords.c
+kwlookup.c
+mbprint.c
+print.c
diff --git a/src/include/.gitignore b/src/include/.gitignore
new file mode 100644
index 0000000..da29021
--- /dev/null
+++ b/src/include/.gitignore
@@ -0,0 +1,5 @@
+stamp-h
+pg_config.h
+pg_config_os.h
+dynloader.h
+
diff --git a/src/include/catalog/.gitignore b/src/include/catalog/.gitignore
new file mode 100644
index 0000000..f43fd36
--- /dev/null
+++ b/src/include/catalog/.gitignore
@@ -0,0 +1 @@
+schemapg.h
diff --git a/src/include/parser/.gitignore b/src/include/parser/.gitignore
new file mode 100644
index 0000000..bb33683
--- /dev/null
+++ b/src/include/parser/.gitignore
@@ -0,0 +1 @@
+gram.h
diff --git a/src/include/utils/.gitignore b/src/include/utils/.gitignore
new file mode 100644
index 0000000..52adcb5
--- /dev/null
+++ b/src/include/utils/.gitignore
@@ -0,0 +1,2 @@
+fmgroids.h
+probes.h
diff --git a/src/interfaces/ecpg/compatlib/.cvsignore b/src/interfaces/ecpg/compatlib/.cvsignore
deleted file mode 100644
index 6631b29..0000000
--- a/src/interfaces/ecpg/compatlib/.cvsignore
+++ /dev/null
@@ -1,3 +0,0 @@
-libecpg_compatdll.def
-libecpg_compatddll.def
-blibecpg_compatdll.def
diff --git a/src/interfaces/ecpg/compatlib/.gitignore b/src/interfaces/ecpg/compatlib/.gitignore
new file mode 100644
index 0000000..078b62a
--- /dev/null
+++ b/src/interfaces/ecpg/compatlib/.gitignore
@@ -0,0 +1,7 @@
+libecpg_compatdll.def
+libecpg_compatddll.def
+blibecpg_compatdll.def
+exports.list
+
+libecpg_compat.a
+libecpg_compat.so.*
diff --git a/src/interfaces/ecpg/ecpglib/.cvsignore b/src/interfaces/ecpg/ecpglib/.cvsignore
deleted file mode 100644
index aff208f..0000000
--- a/src/interfaces/ecpg/ecpglib/.cvsignore
+++ /dev/null
@@ -1,3 +0,0 @@
-libecpgdll.def
-libecpgddll.def
-blibecpgdll.def
diff --git a/src/interfaces/ecpg/ecpglib/.gitignore b/src/interfaces/ecpg/ecpglib/.gitignore
new file mode 100644
index 0000000..2d5c333
--- /dev/null
+++ b/src/interfaces/ecpg/ecpglib/.gitignore
@@ -0,0 +1,12 @@
+libecpgdll.def
+libecpgddll.def
+blibecpgdll.def
+exports.list
+
+libecpg.a
+libecpg.so.*
+
+path.c
+pgstrcasecmp.c
+strlcpy.c
+thread.c
diff --git a/src/interfaces/ecpg/include/.gitignore b/src/interfaces/ecpg/include/.gitignore
new file mode 100644
index 0000000..5a14857
--- /dev/null
+++ b/src/interfaces/ecpg/include/.gitignore
@@ -0,0 +1,2 @@
+ecpg_config.h
+stamp-h
diff --git a/src/interfaces/ecpg/pgtypeslib/.cvsignore b/src/interfaces/ecpg/pgtypeslib/.cvsignore
deleted file mode 100644
index b65650c..0000000
--- a/src/interfaces/ecpg/pgtypeslib/.cvsignore
+++ /dev/null
@@ -1,3 +0,0 @@
-libpgtypesdll.def
-libpgtypesddll.def
-blibpgtypesdll.def
diff --git a/src/interfaces/ecpg/pgtypeslib/.gitignore b/src/interfaces/ecpg/pgtypeslib/.gitignore
new file mode 100644
index 0000000..54a1380
--- /dev/null
+++ b/src/interfaces/ecpg/pgtypeslib/.gitignore
@@ -0,0 +1,9 @@
+libpgtypesdll.def
+libpgtypesddll.def
+blibpgtypesdll.def
+exports.list
+
+libpgtypes.a
+libpgtypes.so.*
+
+pgstrcasecmp.c
diff --git a/src/interfaces/ecpg/preproc/.cvsignore b/src/interfaces/ecpg/preproc/.cvsignore
deleted file mode 100644
index b89e319..0000000
--- a/src/interfaces/ecpg/preproc/.cvsignore
+++ /dev/null
@@ -1,4 +0,0 @@
-preproc.y
-preproc.c
-preproc.h
-pgc.c
diff --git a/src/interfaces/ecpg/preproc/.gitignore b/src/interfaces/ecpg/preproc/.gitignore
new file mode 100644
index 0000000..04dc12e
--- /dev/null
+++ b/src/interfaces/ecpg/preproc/.gitignore
@@ -0,0 +1,7 @@
+preproc.y
+preproc.c
+preproc.h
+pgc.c
+
+ecpg
+kwlookup.c
diff --git a/src/interfaces/libpq/.cvsignore b/src/interfaces/libpq/.cvsignore
deleted file mode 100644
index f5f9ac0..0000000
--- a/src/interfaces/libpq/.cvsignore
+++ /dev/null
@@ -1,4 +0,0 @@
-libpqdll.def
-libpqddll.def
-blibpqdll.def
-libpq-dist.rc
diff --git a/src/interfaces/libpq/.gitignore b/src/interfaces/libpq/.gitignore
new file mode 100644
index 0000000..8d6941e
--- /dev/null
+++ b/src/interfaces/libpq/.gitignore
@@ -0,0 +1,12 @@
+libpq.a
+libpq.so.*
+
+encnames.c
+exports.list
+ip.c
+md5.c
+noblock.c
+pgstrcasecmp.c
+strlcpy.c
+thread.c
+wchar.c
diff --git a/src/pl/plperl/.gitignore b/src/pl/plperl/.gitignore
new file mode 100644
index 0000000..4dd7889
--- /dev/null
+++ b/src/pl/plperl/.gitignore
@@ -0,0 +1,4 @@
+SPI.c
+Util.c
+perlchunks.h
+plperl_opmask.h
diff --git a/src/pl/plpgsql/src/.cvsignore b/src/pl/plpgsql/src/.cvsignore
deleted file mode 100644
index fa18d49..0000000
--- a/src/pl/plpgsql/src/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-pl_gram.c
-pl_gram.h
diff --git a/src/pl/plpgsql/src/.gitignore b/src/pl/plpgsql/src/.gitignore
new file mode 100644
index 0000000..fa18d49
--- /dev/null
+++ b/src/pl/plpgsql/src/.gitignore
@@ -0,0 +1,2 @@
+pl_gram.c
+pl_gram.h
diff --git a/src/port/.gitignore b/src/port/.gitignore
new file mode 100644
index 0000000..9e55338
--- /dev/null
+++ b/src/port/.gitignore
@@ -0,0 +1,3 @@
+libpgport.a
+libpgport_srv.a
+pg_config_paths.h
diff --git a/src/test/regress/.gitignore b/src/test/regress/.gitignore
new file mode 100644
index 0000000..63ab829
--- /dev/null
+++ b/src/test/regress/.gitignore
@@ -0,0 +1,7 @@
+# Local binaries
+pg_regress
+
+# Generated subdirectories
+tmp_check
+results
+log
diff --git a/src/test/regress/expected/.gitignore b/src/test/regress/expected/.gitignore
new file mode 100644
index 0000000..e0e4b8e
--- /dev/null
+++ b/src/test/regress/expected/.gitignore
@@ -0,0 +1,8 @@
+constraints.out
+copy.out
+create_function_1.out
+create_function_2.out
+largeobject.out
+largeobject_1.out
+misc.out
+tablespace.out
diff --git a/src/test/regress/sql/.gitignore b/src/test/regress/sql/.gitignore
new file mode 100644
index 0000000..e427d40
--- /dev/null
+++ b/src/test/regress/sql/.gitignore
@@ -0,0 +1,7 @@
+constraints.sql
+copy.sql
+create_function_1.sql
+create_function_2.sql
+largeobject.sql
+misc.sql
+tablespace.sql
diff --git a/src/timezone/.gitignore b/src/timezone/.gitignore
new file mode 100644
index 0000000..f844c9f
--- /dev/null
+++ b/src/timezone/.gitignore
@@ -0,0 +1 @@
+/zic