Skip to content

Instantly share code, notes, and snippets.

@J00MZ
Created July 28, 2025 13:03
Show Gist options
  • Save J00MZ/54682bf45315abc69bd471fc8ccc87c8 to your computer and use it in GitHub Desktop.
Save J00MZ/54682bf45315abc69bd471fc8ccc87c8 to your computer and use it in GitHub Desktop.
push all repos to Gitlab
#!/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