Created
January 27, 2022 13:23
-
-
Save sergirf/1a96fb05b3f89023fd45da06afbefee7 to your computer and use it in GitHub Desktop.
run this command from the folder where all the subdirectories with git repositories are and this will create a new github repo for each one and push it all branches, commits and tags. You only have to replace ${GITHUB_ORG} for the actual name or deleted it if no ORG is needed. As a requirement it is using GitHub CLI https://cli.github.com/
This file contains 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
for dir in *; do (cd "$dir" && git remote rm origin && gh repo create ${GITHUB_ORG}/"$dir" --private --source=. --remote=origin --push && git push --all && git push --tags); done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment