0

I work on a project that has many repositories (>70) for its components. Now some files (GitHub issues templates, CONTRIBUTE.md etc) have to be added to all of them.

I imagine this is a use case other people could have encountered before and found a way to not have to do this manually.

Is there a simple way to copy, commit and push all those file over to these multiple repositories?


As those files might have to be modified later in their copied-to location - some repositories have their special requirements for the issue templates for example - using git submodules (as suggested in the "possible duplicate comment to a question from 2011) is not an option. (CONTRIBUTE.md in root obviously wouldn't work with submodules at all)

janpio
  • 10,645
  • 16
  • 64
  • 107
  • 2
    You might write some (Unix) shell script for that purpose. Some of that could go into `git` hooks – Basile Starynkevitch Aug 23 '18 at 10:28
  • 1
    Possible duplicate of [Using git for a project with many, many repos](https://stackoverflow.com/questions/8223921/using-git-for-a-project-with-many-many-repos) – phd Aug 23 '18 at 12:36
  • @BasileStarynkevitch I was hoping to avoid that as I am really bad at it (and using Windows). Basically iterate over all the targets, copy the files there and run the commands to commit and push, right? – janpio Aug 24 '18 at 07:37
  • I don't know.... I recommend considering using some Linux distribution, since IMHO Linux is very developer friendly. BTW, you should **edit your question** to explain a lot more what is your project (what is it doing, how many millions lines of code has it, in what programming languages, how do you build it -what build automation tool you are using- and why does it have that much repositories.... I tend to think that having that much repositories smells very bad; did you consider reorganizing that project, e.g. using libraries in it) and give more context and motivations. – Basile Starynkevitch Aug 24 '18 at 07:45
  • My guess might be that (independently of your `git` related question) your project could be messy and require some reorganization and refactoring. And certainly it is only a guess, since you don't explain enough what your project is... Notice that `git` does not claim to be the solution to all problems! And you need to explain why git submodules are not possible. Perhaps you might have much less repositories and organize your workflow differently – Basile Starynkevitch Aug 24 '18 at 07:52
  • So IMHO having 70 git repositories for a single project is the symptom of something very wrong (unless you explain a lot more what is your project and why is it so weird) – Basile Starynkevitch Aug 24 '18 at 07:56
  • BTW, you don't explain well enough why `git submodules` is not an option – Basile Starynkevitch Aug 24 '18 at 08:12
  • Not? I thought the fact that the file have to be change-able per repository after copying them over there would be a show-stopper to use git submodules. – janpio Aug 24 '18 at 10:21
  • Re your other comments: As the facts about the project are unchangeable (in short: Open Source tool that is used by many people and had this structure for ~10 years) I did not explain those - I have to live with them and find a solution to the _actual_ problem. – janpio Aug 24 '18 at 10:23

0 Answers0