Last active
May 15, 2019 20:37
-
-
Save gerhc/4eaa6df48547c46c2e683a2c258d8976 to your computer and use it in GitHub Desktop.
script to clone, bundle and backup git repositories
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
import sh | |
organization = "gerhc" | |
repos = [] | |
DESTINATION_FOLDER = "./repo_bundles" | |
for repo in repos: | |
print(f"Bundling {repo}") | |
sh.git("clone", f"[email protected]:{organization}/{repo}.git") | |
sh.git("bundle", "create", f"{repo}.bundle", "--all", _cwd=f"./{repo}") | |
sh.mv(f"./{repo}/{repo}.bundle", DESTINATION_FOLDER) | |
sh.rm("-rf", repo) | |
print(f"Finished bundling {repo}") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment