Trying to clone 1 build file from 1 repo to another and use it in build

I have written 1 common build file that runs few common tasks for all repo. I am trying to put it in 1 common_repo, so that other repositories can pull the build file on the fly while compiling their project. I need this common file to clone first in individual repo in defined directory and then start the compilation process.
I tried to use ‘apply from’, but it is not helping either.
Is there any way we can pull common build file from different repo as first task and then use it for further build process. We don’t want to maintain this common file in each repo, as it will be a maintenance nightmare.
Let me know if you need more data. Kindly help.

There are a couple different ways that you can do this.

  1. Use curl to download the build file as the first step in a generic build script
  2. Use git submodules to include the build tools in all repos

and probably more. It depends on how complex of a script it is and how often it is going to be updated.