Link databases to source control automatically

I would like to know if there is any way to link the databases to source control by command line, or in an automated way somehow. Our project involves more than 50 databases, so linking them manually takes a long time.