Deutsch   English   Français   Italiano  
<6dd231eebff2c27d33e43d6f004f581c@msgid.frell.theremailer.net>

View for Bookmarking (what is this?)
Look up another Usenet article

From: Fritz Wuehler <fritz@spamexpire-202505.rodent.frell.theremailer.net>
Subject: Re: Git automation
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
References: <vv6221a1c2@gallifrey.nk.ca>
Message-ID: <6dd231eebff2c27d33e43d6f004f581c@msgid.frell.theremailer.net>
Date: Sun, 04 May 2025 02:37:42 +0200
Newsgroups: comp.os.linux.misc
Path: news.eternal-september.org!eternal-september.org!feeder3.eternal-september.org!news.mixmin.net!news2.arglkargh.de!alphared!sewer!news.dizum.net!not-for-mail
Organization: dizum.com - The Internet Problem Provider
X-Abuse: abuse@dizum.com
Injection-Info: sewer.dizum.com - 2001::1/128

The Doctor <doc...@doctor.nl2k.ab.ca> [TD]:
TD> How can i cron a script so that the git pull can be run in the
TD> subdirectories with a .git subdirectory , ogin to the next one
TD> until done and report results in e-mail ?


# get a list of directories with .git
find "/path/to/" -type d -name '.git' -print0 |

# prepare a bunch of shell commands
xargs -0 --replace=MY_GIT_DIR  \
  echo '(D='MY_GIT_DIR';
         cd "$D" && echo Working in "$D";
         git pull your_git_options_here;
        )' |

# execute them sequentially
sh 2>&1 |

# and send their output somewhere by email
mail -s 'git jobs output' me@example.com