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.

Revisions

  1. yashwanth-l created this gist Jul 8, 2024.
    5 changes: 5 additions & 0 deletions update-git-recursively.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    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 \;