Created
July 28, 2025 13:03
-
-
Save J00MZ/54682bf45315abc69bd471fc8ccc87c8 to your computer and use it in GitHub Desktop.
push all repos to Gitlab
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
#!/bin/bash | |
REPO_NAMES=${REPO_NAMES_LIST:-'test-repo'} | |
GROUP_NAME="${GROUP_NAME:-'my-group'}" | |
for repo in "${REPO_NAMES[@]}" | |
do | |
echo "Pushing to repo $repo" | |
cd "${repo}" || exit | |
git remote rename origin old-origin | |
git remote add origin [email protected]:${GROUP_NAME}/${repo}.git | |
git push --set-upstream origin --all | |
git push --set-upstream origin --tags | |
cd .. | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment