Created
December 28, 2020 16:50
-
-
Save lebalz/e188f3eb2dffcef0d70e5f2391921dd9 to your computer and use it in GitHub Desktop.
sync all git projects in a folder
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pathlib import Path | |
import os | |
root = Path(__file__).parent | |
git_folders = root.rglob("*.git") | |
for git_dir in git_folders: | |
git = git_dir.parent | |
print('stash and pull master: ', git) | |
res = os.system(f'(cd {git} && git stash && git checkout master && git pull)') | |
print(res) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment