git-for-each-repo - Linux


git-for-each-repo is a versatile tool for executing commands in multiple Git repositories simultaneously. It simplifies managing and operating on large collections of repositories, making it an invaluable aid in continuous integration, orchestration, and DevOps workflows.


git for-each-repo [--dry-run] [--verbose] <command>


  • --dry-run: Executes the command without making any changes to the repositories.
  • --verbose: Prints additional information, including the path to each repository and the output of the command.


  • Execute a command in all repositories in the current directory:
git for-each-repo git status
  • Execute a command in all repositories matching a pattern:
git for-each-repo -- globstar '**/subdirectory' git diff --color
  • Execute a command with multiple arguments:
git for-each-repo 'git branch; git fetch'

Common Issues

  • Command not found: Ensure that git-for-each-repo is installed and available in the system’s path.
  • Permission denied: Verify that you have sufficient permissions to execute the specified command in each repository.


  • Scripting: Combine git-for-each-repo with scripting languages to automate complex workflows involving multiple repositories.
  • Continuous Integration (CI): Use git-for-each-repo in CI pipelines to run tests, build artifacts, and perform other tasks across multiple repositories.
  • DevOps: Leverage git-for-each-repo in DevOps practices to manage software development and deployment across multiple projects.

Related Commands

  • git clone
  • git fetch
  • git push