Writing/Git-xargs allows you to run commands and scripts against many Github repos simultaneously
§ 03 · Applied AI

Git-xargs allows you to run commands and scripts against many Github repos simultaneously

Git-xargs allows you to run commands and scripts against many Github repos simultaneously

Git-xargs allows you to run commands and scripts against many Github repos simultaneously
Plate · Essay · Apr 19, 2021

Demo

git-xargs demo

Intro

have you ever needed to add a particular file across many repos at once? Or to run a search and replace to change your company or product name across 150 repos with one command? What about upgrading Terraform modules to all use the latest syntax? How about adding a CI/CD configuration file, if it doesn’t already exist, or modifying it in place if it does, but only on a subset of repositories you select?

You can handle these use cases and many more with a single git-xargs command. Just to give you a taste, here’s how you can use git-xargs to add a new file to every repository in your Github organization:


git-xargs \
  --branch-name add-contributions \
  --github-org my-example-org \
  --commit-message "Add CONTRIBUTIONS.txt" \
  touch CONTRIBUTIONS.txt

In this example, every repo in the my-example-org GitHub org have a CONTRIBUTIONS.txt file added, and an easy to read report will be printed to STDOUT :

Git xargs table report

Try it out

git-xargs is free and open-source - so you can grab it here: https://github.com/gruntwork-io/git-xargs

Learn more

Read the introductory blog post to better understand what git-xargs can do and its genesis story.

The Modern Coding letter
Applied AI dispatches read by 5,000+ engineers
No spam. Unsubscribe in one click.
Zachary Proser
About the author

Zachary Proser

Applied AI at WorkOS. Formerly Pinecone, Cloudflare, Gruntwork. Full-stack — databases, backends, middleware, frontends — with a long streak of infrastructure-as-code and cloud systems.

Discussion

Giscus