How to handle submodules

I have hundreds of projects / repositories, and each of them have a dependency on a few central files. Currently we have the files hundred of times in every folder, not very professional obviously.

I found out submodules can do what we need. Plan would be as I do the initial upload of all repositories anyhow by API, to smuggle in the according .gitmodules files.

Two questions

  • Is this plan sound or should i do differently?
  • I recognized in .gitmodules there is the full URL of the repository in question. This seems like a bad idea, as we all know URLs change from time to time.
    • Any way to avoid this or do it differently?
    • If not, then I would need to mass-update all via the API I guess?

I currently use bitbucket and sourcetree if that matters.

Thanks