Solved PostgreSQL: Place .conf Files Under Version Control

I'm running PostgreSQL 16 (to be upgraded eventually) running on FreeBSD 14.3 (also to be upgraded eventually.) I would like to put my configuration files under source control. Obviously I don't want to make my entire PGDATA a Git repo, so I want to move the files to their own directory. As I see it, I could:
  1. Set at build time?
  2. Set in rc.conf?
  3. Symlink the .conf files back to PGDATA?
What is the best way to do this, and how?
 
I'd put the whole directory under Git control, then either simply exclude all the stuff which you want to ignore (using .gitignore and/or .git/info/exclude) or you could reconfigure Git and then tell it to only bother with monitored files and ignore everything else.

(edit) => For example by using status.showUntrackedFiles.
 
I'd put the whole directory under Git control, then either simply exclude all the stuff which you want to ignore (using .gitignore and/or .git/info/exclude) or you could reconfigure Git and then tell it to only bother with monitored files and ignore everything else.

(edit) => For example by using status.showUntrackedFiles.
It's been so long since I did anything with .gitignore I'd almost forgotten about it. :oops:

Anyway, I've done this, with my .gitignore set to
Code:
# ignore everything
*

# except conf files
!*.conf
!.gitignore

# but do ignore auto.conf
*.auto.conf
 
Back
Top