Created
July 26, 2020 17:26
-
-
Save vinayakg/45160e15c8d70e410ec1b42787481ee1 to your computer and use it in GitHub Desktop.
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
#!/bin/sh | |
gituser=""; | |
curl --user $gituser https://api.bitbucket.org/2.0/repositories/$ORGNAME\?pagelen\=20 | jq '.values[] |.links.clone[1].href' > repo.out | |
filename="repo.out" | |
while read -r line; do | |
name="$line" | |
git clone $name | |
reponame=$(echo $name | awk -F/ '{ print $2 }' | cut -d . -f1) | |
mkdir -p /tmp/$reponame | |
cd /tmp/$reponame | |
git init | |
hub create | |
git push -u origin HEAD | |
cd - | |
cd $reponame | |
git remote add upstream https://github.com:USER/PROJECT.git | |
git push upstream master | |
git push --tags upstream | |
cd - | |
done < "$filename" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment