How one team synced template updates across 68 repos using git cherry-pick
A development team managing roughly 100 repositories discovered that 68 of them, all created from the same GitHub template, had diverged significantly in version — ranging from 1.0.0 to 4.35.4. GitHub template repositories create a full copy with no shared commit history, making standard git merge and rebase operations fail due to unrelated histories. The team found that git cherry-pick, which applies patches without requiring a common ancestor, was the only native git tool capable of propagating upstream template changes into child repositories. To handle edge cases, they built rules distinguishing files fully owned by the repo, files partially shared with the template, and files entirely owned by the template, ensuring local customisations were preserved during updates. They also added safeguards such as rolling back failed runs entirely, skipping merge commits with --no-merges, and explicitly listing every file the template overwrote so engineers could review unintended changes.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.


Discussion (0)
Log in to join the discussion and vote.
Log in