Look into ".gitignore", also consider manually adding the files you've worked on and wish to commit.
I just make sure to have a single location for sensitive stuff, then ignore/move it.
I will store the contents of the file as an encrypted note in 1Password, so I do have a stored version controlled variant.