Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use `repo forall -c <something>` where <something> is a bash alias or function

Tags:

linux

bash

repo

I've a folder with many git repos. I'm looking for a way to iterate over all the repos and do some fancy listing with a bash function...

like image 373
DavidG Avatar asked Feb 04 '26 06:02

DavidG


1 Answers

According to the documentation, the argument to -c is evaluated by /bin/sh, so if you place your fancy function into a file named functions.sh, then you could do something like:

repo forall -c '. /path/to/functions.sh; myfunction'

Assuming that /bin/sh on your system is actually Bash, or if not:

repo forall -c 'bash -c ". /path/to/functions.sh; myfunction"'
like image 174
larsks Avatar answered Feb 06 '26 00:02

larsks