Skip to content

Instantly share code, notes, and snippets.

@yashwanth-l
Created July 8, 2024 20:01
Show Gist options
  • Save yashwanth-l/a1fcd3f5313eee386e53e5ac1cebd686 to your computer and use it in GitHub Desktop.
Save yashwanth-l/a1fcd3f5313eee386e53e5ac1cebd686 to your computer and use it in GitHub Desktop.
update-git-recursively
find . -type d -depth 1 -exec git --git-dir={}/.git --work-tree=$PWD/{} fetch origin main:main \;
find . -type d -depth 1 -exec git --git-dir={}/.git --work-tree=$PWD/{} merge main \;
find . -type d -depth 1 -exec git --git-dir={}/.git --work-tree=$PWD/{} add -A \;
find . -type d -depth 1 -exec git --git-dir={}/.git --work-tree=$PWD/{} commit -m "commit message example" \;
find . -type d -depth 1 -exec git --git-dir={}/.git --work-tree=$PWD/{} push origin some-branch \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment