Skip to content

Instantly share code, notes, and snippets.

@0x49D1
Last active April 13, 2020 09:00
Show Gist options
  • Save 0x49D1/0c0dcb6241908b9b1943a194761e9b8b to your computer and use it in GitHub Desktop.
Save 0x49D1/0c0dcb6241908b9b1943a194761e9b8b to your computer and use it in GitHub Desktop.
Script to update and publish (pull&push) all git repositories in sub-directories at once.
#!/bin/bash
eval $(keychain --eval id_github_rsa) # in case you use keychain to store keys. https://linux.die.net/man/1/keychain
find . -maxdepth 1 -type d -exec sh -c '(cd {} && echo $PWD && git pull && git push)' ';'
@0x49D1
Copy link
Author

0x49D1 commented Apr 13, 2020

To use it on windows (with linux subsystem WSL) - create bat file with content like:

cd c:\GIT_PROJECTS_DIRECTORY
bash -c "sh ./update_git_repos.sh"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment