I am aware of the clone function that could do this, but the thing it would clone what is in the repo, being everything that was pushed.
What we need is to modify some files in our repository template and create a new repo with these modified files, without having to commit these files (that are project-dependant) to our template, so it stays intact.
Is that even possible? Using “git add”, “git commit” and then “git push” with an extra parameter that would be the remote repository?
Basically, I want the files, not the repo.
Consider the main repository (main) and the repositories inheriting (child1, child2). What I would do to start would be to create a branch per child on the main repository:
Now, you can do:
This pushes branch child1 on the master of repository child1. This way you can keep your main master clean. If this is a one off push, you can remove the branches afterwards. You main need to force the merge on the child repositories if you cannot fast forward (see the refspec for the push).