CAPTCHA
Image CAPTCHA
Enter the characters shown in the image.
This question is for testing whether or not you are human.
  • Create new account
  • Reset your password

User account menu

Home
The Hyperlogos
Read Everything

Main navigation

  • Home
  • My Resumé
  • blog
  • Howtos
  • Pages
  • Contact
  • Search

Script Quickie: Update nested git repos

Breadcrumb

  • Home
  • User Blogs
  • User Blog
  • Script Quickie: Update nested git repos
By drink | Fri March 17, 2023

I am using the AUTOMATIC1111 stable-diffusion distribution, and you can install modules to that. Some modules can be installed and updated from inside of the program, while others cannot. Those other modules have to be updated by doing a git pull. This is not a big job, but it can be made even smaller with a very small shell script.

Here is that very small shell script:

#!/bin/bash
DIR="/opt/sd/stable-diffusion-webui"
for i in `find ${1:-$DIR} -name .git -type d | grep -v repositories`
do 
  pushd `dirname $i`
  git pull
done

The script jumps to each directory which contains a .git folder, and does a git pull. Easy peasy. You can specify a directory on the command line, or it will use the specified directory. You could set $DIR to "." to make it use the current directory instead of specified.

script
  • Log in or register to post comments

Footer menu

  • Contact
Powered by Drupal

Copyright © 2025 Martin Espinoza - All rights reserved