This command updates the repositories in all subfolders inside a folder.
⚠️ The script updates the current banch in each folder.
For e.g. run in code
folder to update respositories in all the subfolders
/code
|
+-- /joaneleon.dev
|
+-- /nucliweb.net
|
+-- /webperfimpacters.com
Run the next line in your terminal to update all the repositories inside a folder.
find . -type d -depth 1 -exec git --git-dir={}/.git --work-tree=$PWD/{} pull --set-upstream origin HEAD \;
Create a Bash Script file, e.g. ~/git-pull-subfolders.sh
, with the next code:
#!/usr/bin/env bash
find . -type d -depth 1 -exec git --git-dir={}/.git --work-tree=$PWD/{} pull --set-upstream origin HEAD \;
Add execute permission to the file with the next command:
chmod +x ~/git-pull-subfolders.sh